Elbarto has asked for the wisdom of the Perl Monks concerning the following question:
where logs* are the files i want to grep through. this works fine when executed with a single serial, but as soon as i try to do it in a loop, it doesnt do anything. It looks like this:exec("grep $serial logs* > $serial.log");
I fear that the solution is painfully obvious, but i'm stuck here now for a good while. Oh, and btw. Super Search didn't help me, i really tried :) greetings, Elbartoopen(SERIALS, "serials.txt") or die("can't open serials.txt"); @serials = <SERIALS>; for my $serial (@serials) { print "now processing $serial"; exec("grep $serial logs* > $serial.log"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: System Call for various serials in a for loop
by roboticus (Chancellor) on Jun 28, 2007 at 10:56 UTC | |
by RMGir (Prior) on Jun 28, 2007 at 12:00 UTC | |
|
Re: System Call for various serials in a for loop
by lima1 (Curate) on Jun 28, 2007 at 09:18 UTC | |
|
Re: System Call for various serials in a for loop
by citromatik (Curate) on Jun 28, 2007 at 09:19 UTC | |
|
Re: System Call for various serials in a for loop
by Elbarto (Initiate) on Jun 28, 2007 at 12:15 UTC | |
by RMGir (Prior) on Jun 28, 2007 at 13:17 UTC | |
by Elbarto (Initiate) on Jun 28, 2007 at 13:45 UTC | |
by lima1 (Curate) on Jun 28, 2007 at 15:27 UTC |