[tutorial] Bash / shell scripts, codes

Download images from a website with looping throw URLs.


max=10
for i in `seq 1 $max`
do
	url="http://www.example.com/$i.jpg"
	response=$(curl --write-out %{http_code} --silent --output /dev/null "$url")
	if [ $response = 200 ]; then
		wget $url
	fi
done