I need to run a linux command, which will return a list of words, then I need to take that list, and each line of the list, I need to use as input into another linux command. I want to use shell scripts to do this. Anyone know if its possible and if so, how?
9/8/2006 4:45:42 AM
I think that you want to use pipes. < > |
9/8/2006 7:58:06 AM
I don't know much about linux scripting languages, but this is what I would do.Just pipe the output to a perl program similar to this:
@lines = <STDIN>;foreach $line (@lines) { system "other-command \"$line\"";}
9/8/2006 9:53:56 AM
meh, stick with pipes. it doesn't sound like you need to go as "complex" as using perl
9/8/2006 9:56:44 AM
The only reason I used perl is that I don't know how to get the lines like that with only shell commands and its a short, trivial perl program.How would you get the lines using only shell commands?
9/8/2006 10:01:17 AM