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

            Bug ID: 232201
           Summary: sh(1): Using unset variables in here-doc with set -u
                    does not cause the script to exit
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

The output of sh(1) from the base and of dash from the ports (shells/dash) is
different.

Here's the script to reproduce this issue:

```
#! /bin/sh -

set -u

# Unset variable.
cat << EOF > /dev/null && echo ok || echo error
$unsetvar
EOF
```

Output of `sh test.sh`:

> testcase-2.sh: unsetvar: parameter not set
> ok

Output of `dash test.sh`:

> testcase-2.sh: 6: testcase-2.sh: unsetvar: parameter not set
> error

I'm running sh(1) from 12.0-ALPHA6 r338797 and dash 0.5.10.2 from ports.

-- 
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