Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- To: MLUG Members <EMAIL:PROTECTED>
- Subject: Re: [MLUG] basic Unix pipe/exit code problem
- From: Scott Hussey <EMAIL:PROTECTED>
- Date: Sat, 5 Mar 2005 09:20:34 -0600
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws;s=beta; d=gmail.com;h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references;b=iw9J9hDQ/WybdKK1C+EI0GOhY7JwO2XhJkAJGTaRPj82wzTapP8AJi+kxs+qn8K9JWfYf5lWc/3STLuVS/ojrz9IKUfZ0fikjctSrIfXkDvLw3FC8jvF2czX6HU0OPnqLRHcODsjVM3YPIkxHYJ8xTA+o6N1dVwxEoL3ILqThxU=
- In-reply-to: <EMAIL:PROTECTED>
- References: <EMAIL:PROTECTED>
- Reply-to: Scott Hussey <EMAIL:PROTECTED>, MLUG Members<EMAIL:PROTECTED>
- Sender: EMAIL:PROTECTED
On Thu, 3 Mar 2005 12:24:49 -0600, Mark Rages <EMAIL:PROTECTED> wrote:
> I have reduced my problem to this:
>
> ( /bin/false | gzip > /dev/null ) || echo fail
>
> I want it to echo "fail" because /bin/false gives a nonzero exit code.
> But it doesn't. What am I missing?
Google "PIPESTATUS" or search for it in the bash man page.
PIPESTATUS
An array variable (see Arrays below) containing a list of exit
status values from the processes in the most-recently-executed
foreground pipeline (which may contain only a single command).
Scott-Husseys-Computer:~/dev/html scott$ false | gzip > /dev/null
Scott-Husseys-Computer:~/dev/html scott$ echo ${PIPESTATUS[*]}
1 0
--
Scott Hussey
EMAIL:PROTECTED
_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members