Source

gosnightmare / fetch.sh

#!/bin/sh

touch .downloaded_files.txt
:> .downloaded_files.txt

for i in $( cat pagelist.txt ); do
	NOME=`echo $i | awk -F"/" '{ print $NF }'`.pdf
	echo item: $i, $NOME
	wget --wait=1 --load-cookies cookies.txt --output-document=$NOME $i
	echo $NOME >> .downloaded_files.txt
done

#--limit-rate=20K
#cat pagelist.txt | xargs -0 -I {} wget --wait=20 --limit-rate=20K --load-cookies cookies.txt -o {}.pdf {}

#cat pagelist.txt | xargs -I {argg} echo /hello/{argg}/123/$(awk -F"/" '{ print $NF }')

#cat pagelist.txt | awk -F"/" '{ print $1 }'
#cat pagelist.txt | awk -F"/" '{ print $NF }' | xargs -n2