in reply to Re: Detecting failed piped command run via ssh
in thread Detecting failed piped command run via ssh

Thanks, but I still get only one entry in @results.
I figure I should get one entry as the contents of the .tar.bz2, and one as whatever is returned by  ;echo \$\{PIPESTATUS\[\@\]\}. Later code writes $results[0] to a file, which bunzip2 reports as corrupt, hence I figure that the backtick method is unable to separate the output of bzip2 -9 -c from  ;echo \$\{PIPESTATUS\[\@\]\}.

Replies are listed 'Best First'.
Re^3: Detecting failed piped command run via ssh
by cdarke (Prior) on Apr 08, 2009 at 11:53 UTC
    When you say there is only one entry in @results, doea that one entry contain output from bzip2, or is it from PIPESTATUS? It could just be that bzip2 is not terminating the record with "\n", in which case inserting a dummy echo after the bzip2 should do the trick.