[Bug 233585] sh(1) ${param?} default error message is broken

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Nov 27 22:30:52 UTC 2018


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

            Bug ID: 233585
           Summary: sh(1) ${param?} default error message is broken
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: regression
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: jilles at FreeBSD.org
          Reporter: jilles at FreeBSD.org
                CC: bugs at FreeBSD.org

*background*

The expansion ${param?word} is like ${param} but causes the shell to abort when
param is not set. The word is expanded and written as an error message; if it
is omitted (${param?}), a default error message is written.

*steps to reproduce*

sh -c 'unset something; ${something?}'

*expected results*

Output containing "something: parameter not set" and non-zero exit status.

*actual results*

Output of an empty line and non-zero exit status.

*notes*

This is a regression caused by SVN r316417. It affects stable/12 but not
stable/11.

If the ${something?} is nested within another expansion, like
${other-${something?}}, the default error message does appear but is corrupted
("sh: something=: parameter not set").

The shell does exit or not exit when it should; this bug probably only makes
debugging harder.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-bugs mailing list