From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 25 14:03:00 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E57EF106564A for ; Mon, 25 Jun 2012 14:03:00 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 72AA18FC0C for ; Mon, 25 Jun 2012 14:03:00 +0000 (UTC) Received: by bkvi18 with SMTP id i18so3991809bkv.13 for ; Mon, 25 Jun 2012 07:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:in-reply-to:references:x-mailer; bh=pYz0kG9NxHICYj3z0yVT64lpHHINSAiHIL4C1SiLfDU=; b=GSocF+xg9kHxcDfMNS3ssoRApE7Lbkq2/x2mBesSwHCklwe0k013JbzP+EC1x1Owgl GLCYMX29IJ1gO7aWQzMKnv18OT4gUnDcmziG11vSUHQlGyYzvacafxi8UQ1F+blMl1N6 7atI1JBTTs/EAUy/VlsHN+Iva9gDKdKN4SFiOMyoJJajnSKRWOwXtVeef5sllqRzwJMx uctlBu0bY0kfpJJTNDI8jWBF6BwSFXd+nuazsI1hzTKVhTUt4C0urUL6uwgMQV4mFv8U hv3nS25dhhtqUaUdAVo4OJEea0TJyIYYSo8xGtNoI9m0a17wJ8DL+Z3aVc/e5GuDd91v iuog== Received: by 10.204.154.142 with SMTP id o14mr3839297bkw.116.1340632979449; Mon, 25 Jun 2012 07:02:59 -0700 (PDT) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id u8sm46719872bks.0.2012.06.25.07.02.33 (version=SSLv3 cipher=OTHER); Mon, 25 Jun 2012 07:02:57 -0700 (PDT) Message-ID: <20120625.140256.620.1@DOMY-PC> From: rank1seeker@gmail.com To: "Johan van Selst" , hackers@freebsd.org Date: Mon, 25 Jun 2012 16:02:56 +0200 In-Reply-To: <20120623171407.GA32232@mud.stack.nl> References: <20120622.192538.734.2@DOMY-PC> <20120623171407.GA32232@mud.stack.nl> X-Mailer: POP Peeper (3.8.1.0) Cc: Subject: Re: tcsh's exit codes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 14:03:01 -0000 ----- Original Message ----- From: Johan van Selst 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.