in reply to Re: Returning status to parent from pipe
in thread Returning status to parent from pipe

Thanks for the replies I had read about the PIPESTATUS variable in bash ..... for some reason I thought that a perl exec would always run in 'sh'. It does on my system. Apologies if this is a very basic question, but can I change that so that it does run in a bash shell?
  • Comment on Re^2: Returning status to parent from pipe

Replies are listed 'Best First'.
Re^3: Returning status to parent from pipe
by ikegami (Patriarch) on Aug 25, 2010 at 23:01 UTC
    On my system, /bin/sh runs bash. But you could specify which shell you want.
    exec(bash => (-c => 'com1 | com2; exit $PIPESTATUS[0]'));