Actually I have a much larger perl script where I run a bunch of commands from the command line in between back tacs like
$line=`cmd 1; cmd 2 ; cmd 3 .... cmd n `;
Now for one of the commands I have to run it for only 4 secs. Now the only way I could come up with is like this :
alarm() { /bin/perl -e 'alarm shift; exec @ARGV' "$@"; } ;alarm 4 'cmd 4 '
Now when I try to put that in a perl script between back tacs it doesnt work.
This code doesnt work.
$line=`cmd 1; cmd 2 ; cmd 3 ;alarm() { /bin/perl -e 'alarm shift; exec
+ @ARGV' "$@"; } ;alarm 4 'cmd 4 '.... cmd n `;
Is there anyway I can make the cmd 4 run for 4 secs only.
|