#!/usr/bin/env perl
my @a = ("sh -c 'asdfsadf ls'", "echo hi", "echo a");
foreach my $b (@a)
{
if(fork()==0)
{
exec($b);
die "Gahh: $b";
}
}
print "done\n";
Note what happens when in the case of sub shells and exec:
perl -e "exec('sh -c asdflkj'); die 'gahh';"
No comments:
Post a Comment