From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28143 invoked from network); 19 Nov 2006 23:50:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Nov 2006 23:50:37 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 78563 invoked from network); 19 Nov 2006 19:50:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Nov 2006 19:50:30 -0000 Received: (qmail 4175 invoked by alias); 19 Nov 2006 19:50:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23006 Received: (qmail 4164 invoked from network); 19 Nov 2006 19:50:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Nov 2006 19:50:27 -0000 Received: (qmail 78310 invoked from network); 19 Nov 2006 19:50:27 -0000 Received: from mtaout03-winn.ispmail.ntl.com (81.103.221.49) by a.mx.sunsite.dk with SMTP; 19 Nov 2006 19:50:24 -0000 Received: from aamtaout02-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20061119195049.HRQH1865.mtaout03-winn.ispmail.ntl.com@aamtaout02-winn.ispmail.ntl.com> for ; Sun, 19 Nov 2006 19:50:49 +0000 Received: from pwslaptop.csr.com ([82.6.99.79]) by aamtaout02-winn.ispmail.ntl.com with ESMTP id <20061119195036.JSI1848.aamtaout02-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 19 Nov 2006 19:50:36 +0000 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.8/8.13.7) with ESMTP id kAJJoHVm003181 for ; Sun, 19 Nov 2006 19:50:19 GMT Message-Id: <200611191950.kAJJoHVm003181@pwslaptop.csr.com> From: Peter Stephenson To: zsh-workers@sunsite.dk Subject: Re: error code for failure to execute In-Reply-To: Message from Clint Adams of "Fri, 17 Nov 2006 22:47:10 EST." <20061118034710.GA31046@scowler.net> Date: Sun, 19 Nov 2006 19:50:17 +0000 Clint Adams wrote: > Does this make sense? > > $ touch /tmp/nonex > $ chmod 0 /tmp/nonex > $ (/tmp/nonex) 2>/dev/null || echo $? > 127 > $ (/tmp/nonex) > zsh: permission denied: /tmp/nonex > $ echo $? > 126 > $ (/tmp/nonex) 2>/dev/null > $ echo $? > 127 > $ Yes, I think so, but I don't really understand the question. Are you asking about the following? http://www.opengroup.org/onlinepubs/009695399/toc.htm 2.8.2 Exit Status for Commands ... If a command is not found, the exit status shall be 127. If the command name is found, but it is not an executable utility, the exit status shall be 126. Applications that invoke utilities without using the shell should use these exit status values to report similar errors. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/