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

Parse errors don't cause a non-zero exit code?



$ echo "'" > /tmp/test ; zsh -f /tmp/test ; echo $?
/tmp/test:2: unmatched '
0

ksh93, ash, and bash all return non-zero here, and it looks like
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_08
wants a non-zero result also.

A co-worker asked about it because he wanted to use "zsh -n" to test
user-submitted scripts for silly typos before running them.  Checking
for output on stderr is a workaround.

A related comment: The zsh documentation uses all six combinations of
"{exit,return} {code,value,status}", making it hard to search :(

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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