File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -92,22 +92,19 @@ oeis() (
9292 if [[ -f $TMP/code_snippet && $(wc -c < $TMP/code_snippet) -ne 0 ]]
9393 then
9494 # Get authors
95- cat ${TMP}/code_snippet \
96- | grep -o ' _[A-Z]. * [A-Z]. * _, [A-Z]. * [0-9] ' \
95+ grep -o ' _[A-Z]. * [A-Z]. * _, [A-Z]. * [0-9] ' ${TMP}/code_snippet \
96+ | sed ' s/,. * // ' \
9797 | sort -u \
9898 > ${TMP}/authors
9999 i=1
100100 # Replace authors with numbers
101101 while read author
102102 do
103103 author=$(<<<"$author" sed ' s/[]\\\*\(\. []/\\ &/g' )
104- sed -i "s|${author}|[${i}]|" ${TMP}/code_snippet
105- author_url=' https://oeis.org/wiki/User:' "${author%%,*}"
104+ sed -i "s|${author}.*[0-9]|[${i}]|" ${TMP}/code_snippet
105+ author=$(echo $author | tr -d ' _\\ ' )
106+ author_url=' https://oeis.org/wiki/User:' "$(echo ${author} | tr ' ' ' _' )"
106107 echo "[${i}] [${author}] [${author_url}]" \
107- | tr -d ' _' \
108- | rev \
109- | sed ' s/ /_/' \
110- | rev \
111108 >> ${TMP}/bibliograpy
112109 let i++
113110 done <${TMP}/authors
You can’t perform that action at this time.
0 commit comments