Sample Resource List
such as Url.txt:
http://su.bdimg.com/static/superplus/img/logo_white_ee663702.pnghttp:// Su.bdimg.com/static/superplus/img/logo_white_ee663703.pnghttp://su.bdimg.com/static/ Superplus/img/logo_white_ee663701.pnghttp://Su.bdimg.com/static/superplus/img/logo_white_ Ee663704.pnghttp://su.bdimg.com/static/superplus/img/logo_white_ee663705.pnghttp:/ /su.bdimg.com/static/superplus/img/logo_white_ee663706.png
The script is as follows:
download.sh
#!/bin/bash# desc:download resource# author:johnmydir=' pwd ' whileRead Line Do{ if[-N"$line"] then CD $mydir URL=$ (Echo"$line"| Tr-d'\ r') Picdir=$ (echo $url | sed-r's/http:\/\///g') Picname=$ (Echo ${picdir##*/}) Picpath=$ (Echo ${picdir%/*}) mkdir-p $picpath cd $picpath wget-o $picname ' echo $url ' Fi}done < $1exit 0
Run:
SH download.sh url.txt
Shell script implements bulk download of resources and preserves original paths