Re: Testing standard output and exit statuses from commands in a pipe

2009-04-27 Thread Greg Wooledge
On Mon, Apr 27, 2009 at 05:02:26PM +0300, Angel Tsankov wrote: > I'd like to pipe the output from a command, say A, to another command, say > B, then check if both commands completed successfully (i.e.with exist status > 0) PIPESTATUS An array variable (see Arrays below) con

Testing standard output and exit statuses from commands in a pipe

2009-04-27 Thread Angel Tsankov
Hello! I'd like to pipe the output from a command, say A, to another command, say B, then check if both commands completed successfully (i.e.with exist status 0) and, if so, compare the standard output from command B to some string. How can I do this in a bash script? Regards, Angel Tsankov