Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PRINT_EXIT_VALUE option in scripts



The PRINT_EXIT_VALUE option doesn't work in scripts or when a file
is sourced:

----------------------------------------
#!/usr/bin/env zsh

echo $ZSH_VERSION
setopt PRINT_EXIT_VALUE
/bin/false
echo OK
----------------------------------------

ypig% ./tst
5.0.2
OK
ypig% source ./tst
5.0.2
OK

This was already the case with zsh 4.3.10.

Is this intentional? The man page just says:

   PRINT_EXIT_VALUE (-1)
      Print the exit value of programs with non-zero exit status.

Either the behavior or the documentation should be fixed.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author