Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2012 16:02:56 +0200
From:      rank1seeker@gmail.com
To:        "Johan van Selst" <johans@stack.nl>, hackers@freebsd.org
Subject:   Re: tcsh's exit codes
Message-ID:  <20120625.140256.620.1@DOMY-PC>
In-Reply-To: <20120623171407.GA32232@mud.stack.nl>
References:  <20120622.192538.734.2@DOMY-PC> <20120623171407.GA32232@mud.stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----
From: Johan van Selst <johans@stack.nl>
To: rank1seeker@gmail.com
Cc: hackers@freebsd.org
Date: Sat, 23 Jun 2012 19:14:07 +0200
Subject: Re: tcsh's exit codes

> rank1seeker@gmail.com wrote:
> > There is something wrong with tcsh shell:
> > 
> > # mergemaster -V | grep '\--run-updates'
> >     Returned exit code 1
> > # mergemaster -V | grep -q '\--run-updates'
> >     Returned exit code 141
> 
> I believe this has been a feature of csh and tcsh since the dark ages.
> Negative status codes propagate through pipelines (and through backtick
> sub-commands as well). In fact the returned $status value is the value
> of the last command that returned an error (non-zero) status code.
> This makes it easy to determine if a pipeline command sequence has
> failed.
> 
> The 141 status code indicates a sigpipe: the pipeline was not completely
> read (as described in the grep manual for this case). This also is the
> common exit code when using head(1) for example.
> 
> This error-propagation behaviour can be suppessed with 'unset anyerror'
> in tcsh. In that case it should work as you expect. But note that your
> commands are no longer compatible with 'good old' csh behaviour then.
> 
> 
> Regards,
> Johan


Thanks for clarification J.

D.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120625.140256.620.1>