https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293212

Jilles Tjoelker <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open

--- Comment #1 from Jilles Tjoelker <[email protected]> ---
I originally implemented it like this for compatibility with the original
implementation that expanded the here-document in a child process. That change
(4dc6bdd3e7e670c195cd66b9319b4059f572cdfc in git) was intended to improve
performance without changing behaviour much. However, I agree the behaviour is
not ideal.

Most shells appear to treat this expansion error in a here-document like a
redirection error, so it causes the shell to skip executing the command and
return a non-zero exit status, and if the command is a special builtin the
shell also aborts (i.e. even if `set -e` is not in effect).

There may be a difference in the handling of expansion errors in a
here-document and in a redirection pathname. The latter causes the shell to
abort in our sh, dash and mksh.

Shells differ in whether side effects from here-document expansion (such as
${x:=1} and $((x+=1))) persist. In our sh, bash and zsh, they do not and in
most others (dash, mksh, ksh93) they do. We could change this too if it is more
expected.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to