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

Jilles Tjoelker <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |[email protected]

--- Comment #1 from Jilles Tjoelker <[email protected]> ---
Although dash is not necessarily a good reference (since it has various bugs
and shortcuts of itself), I checked this against bash --posix and ksh93 and the
common behaviour seems to be that an expansion error in a here-document is
treated as a redirection error (so the redirected command is not executed and
for some types of command the shell aborts).

When I last changed here-document expansion in SVN r246288, I left the error
and side effect behaviour unchanged from what it was to minimize the risk of
breaking existing scripts.

A related test case:
sh -c 'd=/dev/null; : <"${d#$((a=1))}"; true <"${d#$((b=2))}"; /usr/bin/true
<"${d#$((c=3))}"; echo "a=$a b=$b c=$c"'

Most shells seem to agree that this should output a=1 b=2 c=3.

Bash (POSIX mode as well as default mode) has different behaviour between true
(keeps side effects) and /usr/bin/true (discards side effects). This seems
incorrect.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to