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

Re: [PATCH] More ERR_EXIT (was Re: Tests RE behavior of ERR_EXIT)



On Sun, Nov 13, 2022, at 3:55 PM, Philippe Altherr wrote:
> Thus, compound commands other than subshells never have to trigger
> an ERR_EXIT.

This is not necessarily true, depending on how you attribute blame
for what triggers the early exit.  In the following case, it wouldn't
be unreasonable to associate the failed redirection with the "if"
command.  It's certainly not true that only simple commands can
cause early exits.

	% cat foo.zsh
	if :; then
	    :
	fi >/no/such/path

	printf 'done\n\n'

	% zsh foo.zsh
	foo.zsh:1: no such file or directory: /no/such/path
	done

	% zsh -e foo.zsh
	foo.zsh:1: no such file or directory: /no/such/path

-- 
vq




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