in reply to Re^2: one liner in script
in thread one liner in script

This code works for me:
$line=` cmd 1 cmd 2 cmd 3 alarm () { /usr/bin/perl -e ' alarm shift; exec \@ARGV;' -- "\$@" } alarm 4 cmd 4 cmd n `; print "$line";
The differences are:
  1. path to perl (might be different on your system)
  2. escaping the @ sign
  3. escaping the $ sign
  4. Update: the -- separator

Replies are listed 'Best First'.
Re^4: one liner in script
by Anonymous Monk on Apr 12, 2010 at 16:56 UTC
    Ahh xlente... Thank you for helping me . I will put this in the script and check . It should work now.