Skip to content

Commit b388437

Browse files
author
Your Name
committed
Bibliography sources should be names (ignore and consolidate different dates with same name) with links
1 parent 0e678a5 commit b388437

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

share/adapters/oeis.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)