Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scripting help needed!

 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not done any scrpting before. Thanks.

I am using wget to download contents as below:



I want to do this programatically. For example, I have a list of id in a text file as below:

list.txt

----------
23456
78910
..
..
.
.
-----------

How do I programatically open this list.txt and use wget command? Thanks.
Regards

[ UD: fixed CODE tags ]
[ July 09, 2008: Message edited by: Ulf Dittmer ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11887
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I strongly recommend you look at the following 2 options in wget:

Using these is much more friendly than just hammering the server as you try to download 'x' number of files.

As for your actual question - you might want to consider concatenating the file to standard out, piping that through the shell's read command to store it in a variable, then using that. Viz:

Can you see how to use this in your case?

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic