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

            Bug ID: 293212
           Summary: bin/sh does not set exitstatus for heredoc expansion
                    errors
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

```
#! /bin/sh
cat <<EOF
echo "${EMPTY:?}"
EOF
ret=$?
echo $ret
exit $ret
```

Exit statuses:

- sh: 0
- dash: 2
- zsh: 1
- bash: 1

All print `wtf.sh: line 7: EMPTY: parameter null or not set` but /bin/sh does
not set exitstatus to non-0 and does not trigger `set -e`.

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

Reply via email to