Xhings has asked for the wisdom of the Perl Monks concerning the following question:
How can this be done so that for each system date timestamp I get the output of both the above commands? Thanks, Xhings&colstat; sub colstat { my $i=0; while($i<=10){ my $psout = '/my/long/path/memOut.txt'; my $vmstatOut = '/my/long/path/vmstatOut.txt'; system("date >> $vmstatOut"); system("vmstat 2 2 >> $vmstatOut"); system("date >> $psout"); system("ps auxw | grep -v grep >> $psout"); $i++; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: parallel command execution
by flexvault (Monsignor) on Oct 28, 2011 at 09:43 UTC | |
Re: parallel command execution
by johnny_carlos (Scribe) on Oct 28, 2011 at 22:35 UTC |