blob: 76694f1da37da407f667a0883ae85f6557ce59ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/sh
useasp=`has-asp`
download() {
if [ "$useasp" == "true" ]
then
asp-ls "pubmed/$1" |
grep -v ".md5" | grep "xml.gz" |
asp-cp "pubmed/$1"
else
ftp-ls ftp.ncbi.nlm.nih.gov "pubmed/$1" |
grep -v ".md5" | grep "xml.gz" |
ftp-cp ftp.ncbi.nlm.nih.gov "pubmed/$1"
fi
}
if [ "$#" -eq 0 ]
then
echo "Must indicate either baseline or updatefiles"
exit 1
fi
while [ "$#" -gt 0 ]
do
sect="$1"
shift
download "$sect"
if [ $? -ne 0 ]
then
download "$sect"
fi
done
|