分类:
2010-01-11 00:50:19
#!/bin/bash
#a small colorful shell script for download pictures
#2010-1-11 made by yifan
temp=/var/temp urlfile=/var/temp1 if [ !f /var/temp1 ] then touch /var/temp1 fi echo -e "\33[32m" echo "input a .html type url page which contains jpg" echo -e "\33[30m" read webpage curl $webpage >$temp sed -i 's/http:/\nhttp:/g;s/\.jpg/\.jpg\n/g' $temp sed -n '/^http.*jpg$/p' $temp >$urlfile echo -e "\33[34m" echo -e "\tstarting to download pictures,please wait!" for pic in `cat $urlfile` do wget $pic done echo -e "\tpictures have been put into $PWD" echo -e "\33[30m" rm -f $temp $urlfile |