Tech Support > Operating Systems > Linux / Variants > Puzzler For You.
Puzzler For You.
Posted by Josh Beck on November 30th, 2003



Ok, I have constructed a script that boils down to a text file that
simply contains one i.p. address per line. For example:

192.154.123.23
123.234.22.22
22.0.1.1

Now, I want to write a script that performs
wget $ipaddr
for each ip address in the text file.

Any suggestions?

Thanks in advance.




--


Posted by ynotssor on November 30th, 2003


"Josh Beck" <Webmaster@freewebspace.planetdns.net> wrote in message
news:Pine.LNX.4.44.0311301813530.22470-100000@localhost.localdomain

That's perhaps a puzzler for *you*; for one thing, your text file is not a
script. It's best when asking for help to not to be a condescending jerk as
in your Subject: line..

"man bash" and pay attention to the "read" portion of "SHELL BUILTIN
COMMANDS".

--



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

Posted by Erik Max Francis on November 30th, 2003


Josh Beck wrote:

while read ip ; do wget $ip ; done < ips

--
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \
\__/ Blood is the god of war's rich livery.
-- Christopher Marlowe

Posted by Daniel Eyholzer on November 30th, 2003


Josh Beck <Webmaster@freewebspace.planetdns.net> wrote:
Assumed the name of the text file that contains the IP addresses is
"ipfile", the following would do the trick:

for i in `cat ipfile`; do wget $i; done


Cheers, Daniel



------------ And now a word from our sponsor ------------------
Do your users want the best web-email gateway? Don't let your
customers drift off to free webmail services install your own
web gateway!
-- See http://netwinsite.com/sponsor/sponsor_webmail.htm ----

Posted by Noi on December 1st, 2003


On Mon, 01 Dec 2003 00:17:05 +0000, Josh Beck without thinking wrote:

Wouldn't that >$ wget $ipaddr --input-file filelist_of_ipaddresses
or >$ wget $ipaddr -i filelist_of_ipaddr


Posted by mjt on December 1st, 2003


On Mon, 01 Dec 2003 00:17:05 GMT, Josh Beck <Webmaster@freewebspace.planetdns.net> wrote:

..... 'man wget' addresses this

PS - disdainful subject line
..
--
/// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
\\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
Don't worry about the world coming to an end today. It's
already tomorrow in Australia. - Charles Schultz


Similar Posts