Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Calling Program from Command Line for a Variable Range

Credits go to Kitty Cat and Matthew Leverton for helping out!
This thread is locked; no one can reply to it. rss feed Print
Calling Program from Command Line for a Variable Range
Gideon Weems
Member #3,925
October 2003

Hi, all. I'm just a simple bumpkin and will present my problem without abstracting anything:

wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/1.gif
wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/2.gif
wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/3.gif
wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/4.gif
...
wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/X.gif

I don't have many tools in my box... Please help me. I want to call a program from the command line in the above fashion--automatically incrementing an interger and substituting the string value of the integer for the set [1-X].

What standard tool is best suited for this task? Thank you so much for your time.

Yes, they are smileys. :)

Matthew Leverton
Supreme Loser
January 1999
avatar

<?php for($x=1;$x<100;++$x) `wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/$x.gif`; ?>

Any scripting language can do the above...

Even in C, it's probably a 3 line program.

Kitty Cat
Member #2,815
October 2002
avatar

for i in `seq 1 100` ; do wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/${i}.gif ; done

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Gideon Weems
Member #3,925
October 2003

Wonderful! This is how you do it from the Windows command prompt:
for /L %i in (1,1,300) do wget -r -l1 --no-parent http://img.mixi.jp/img/emoji/%i.gif
Thank you for helping me.

Go to: