On Friday 15 October 2010 03:10 AM, Ángel González wrote:
  Tony Lewis wrote:
Having said all of that, you can more easily do the same thing with a shell
script that invokes wget repeatedly. The downside of the shell script
approach is that you won't be reusing the connection to the server.

What if someone does not know Shell Script ?
Scripting is not a feature of Wget, Its a feature of Shell. I want to add this feature to wget so that end users wont have to write script.

You can do it with one connection by piping the input file:

( for i in `seq 1 10`; do echo http://rahulprasad.com/pics/img$i.jpg;
done ) | wget -i -

Or if you are not concerned with portability:
for ((i=1; i<= 10 ; i++))
do
echo http://rahulprasad.com/pics/img$i.jpg
done | wget -i -


If you have bash 4 it's even easier:
wget  http://rahulprasad.com/pics/img{1..10}.jpg

These tricks should be stored somewhere...

yes, I agree. we should inprove our wiki and add these tricks there.



Reply via email to