spring work

This commit is contained in:
ackman678
2021-05-03 21:03:40 -07:00
parent 980e493cf7
commit 29956101f2
2 changed files with 21 additions and 20 deletions

View File

@@ -30,7 +30,8 @@ year=$3
set -e #exit if an error
uid=$(curl -s "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=$author[au]+AND+$journal[ta]+AND+$year[dp]&retmode=xml" | grep -E "<Id>[0-9]+</Id>" | sed -E "s#<Id>([0-9]+)</Id>#\1#")
#curl's option globoff needed for using brackets in a uri
uid=$(curl -s --globoff "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=$author[au]+AND+$journal[ta]+AND+$year[dp]&retmode=xml" | grep -E "<Id>[0-9]+</Id>" | sed -E "s#<Id>([0-9]+)</Id>#\1#")
if [ -z "$uid" ]; then
echo "pubmed id not found"