in reply to System Call for various serials in a for loop
#!/usr/bin/perl use strict; use warnings; open(SERIALS, "serials.txt") or die("can't open serials.txt"); my @serials = <SERIALS>; for my $serial (@serials) { chomp $serial; print "now processing $serial"; system("echo grep $serial logs* > $serial.log"); }
|
|---|