We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73a9a53 commit 89f69bbCopy full SHA for 89f69bb
share/adapters/oeis.sh
@@ -112,11 +112,7 @@ oeis() (
112
> ${TMP}/prog
113
# Print out code sample for specified language
114
rm -f ${TMP}/code_snippet
115
- awk -v tgt="${LANGUAGE^^}" -F'[()]' '/^\(/{f=(tgt==$2)} f' ${TMP}/prog > ${TMP}/code_snippet
116
- L="${LANGUAGE:0:1}"
117
- LANGUAGE="${LANGUAGE:1}"
118
- LANGUAGE="${L^^}${LANGUAGE,,}"
119
- [ $(wc -c < $TMP/code_snippet) -eq 0 ] && awk -v tgt="${LANGUAGE}" -F'[()]' '/^\(/{f=(tgt==$2)} f' ${TMP}/prog > ${TMP}/code_snippet
+ awk -v tgt="${LANGUAGE^^}" -F'[()]' '/^\(/{f=(tgt==toupper($2))} f' ${TMP}/prog > ${TMP}/code_snippet
120
fi
121
# Print code snippet with 4-space indent to enable colorization
122
if [ $(wc -c < $TMP/code_snippet) -ne 0 ]
0 commit comments