Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: error code for failure to execute
- X-seq: zsh-workers 23006
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: error code for failure to execute
- Date: Sun, 19 Nov 2006 19:50:17 +0000
- In-reply-to: Message from Clint Adams <schizo@xxxxxxxxxx> of "Fri, 17 Nov 2006 22:47:10 EST." <20061118034710.GA31046@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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 <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author