zsh-workers
 help / color / mirror / code / Atom feed
* Wrong Exit Codes?
@ 1996-04-16 19:31 Eskandar Ensafi
  1996-04-17  7:32 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Eskandar Ensafi @ 1996-04-16 19:31 UTC (permalink / raw)
  To: zsh-workers


Hello,

Is this a bug or a feature (I would call it a bug, unless there is an
option to turn this behavior off):

If the previous command causes an error, then typing "exit" will exit
zsh (2.6 beta14) with the previous command's non-zero exit code.

For example:

% zsh
% echo good_command
good_command
% exit
% echo $?  # Zero exit code as expected.
0
% zsh
% bad_command
zsh: command not found: bad_command
% exit
% echo $?  # Notice the non-zero exit code.  Doesn't "exit" = "exit 0" ?
1
% exit

This behavior is wrong, isn't it?

Thanks!

- Eskandar



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Wrong Exit Codes?
  1996-04-16 19:31 Wrong Exit Codes? Eskandar Ensafi
@ 1996-04-17  7:32 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1996-04-17  7:32 UTC (permalink / raw)
  To: zsh-workers

esky@cs.ucla.edu wrote:
> Is this a bug or a feature (I would call it a bug, unless there is an
> option to turn this behavior off):
> 
> If the previous command causes an error, then typing "exit" will exit
> zsh (2.6 beta14) with the previous command's non-zero exit code.

This is what the manual says it does.  It's also what the sh manual
says.  It seems to be standard behaviour.  Even the csh manual page
claims it does the same thing, except it actually doesn't (at least
not here).

  exit [ n ]
       Exit the shell with the exit code specified by n; if
       none is specified, use the exit code from the last
       command executed.  An EOF condition will also cause the
       shell to exit, unless the IGNOREEOF option is set.

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-04-17  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-16 19:31 Wrong Exit Codes? Eskandar Ensafi
1996-04-17  7:32 ` Peter Stephenson

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).