From: Felipe Kellermann <stdfk@terra.com.br>
To: zsh-workers@sunsite.dk
Subject: Re: Parse errors don't cause a non-zero exit code?
Date: Fri, 8 Apr 2005 21:50:09 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.61.0504082121240.234@nyvra.alien.bet> (raw)
In-Reply-To: <200504011208.j31C86Qo018462@news01.csr.com>
On Fri, 1 Apr 2005 1:08pm +0100, Peter Stephenson wrote:
> builtin/function returns status X" is a perfectly natural way of saying
> "returns the exit status X" given that the command doesn't actually exit
> (in the UNIX sense). In other words, I don't think I want to play any
> more.
Hi Peter,
About this issue, I have a long-term question about the exit status of zsh
when it gets passed an script as argument:
% zsh a
a: can't open input file: a
% print $?
1
% a
zsh: command not found: a
% print $?
127
%
I am aware that the standard isn't very clear in this respect, but most
shells explicitly interpret both cases the same way, returning 127 when
the shell gets a command as an argument.
$ ksh --version
version sh (AT&T Labs Research) 1993-12-28 q
$ ksh a
ksh: line 1: a: not found
$ echo $?
127
$
$ bash --version
GNU bash, version 3.00.0(1)-release (i586-pc-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
$ bash a
bash: a: No such file or directory
$ echo $?
127
$
I have recently talked with Michael Rendell about this issue on pdksh and
he OK'ed the patch I sent to him, though he is not planning to make a new
release of pdksh :-)
--
Felipe Kellermann
next prev parent reply other threads:[~2005-04-09 0:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-29 23:17 Dan Nelson
2005-03-31 17:14 ` Dan Nelson
2005-04-01 10:07 ` Peter Stephenson
2005-04-01 20:06 ` Dan Nelson
2005-04-01 12:08 ` Peter Stephenson
2005-04-09 0:50 ` Felipe Kellermann [this message]
2005-04-11 10:13 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0504082121240.234@nyvra.alien.bet \
--to=stdfk@terra.com.br \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).