Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2018 22:30:49 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 233585] sh(1) ${param?} default error message is broken
Message-ID:  <bug-233585-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D233585

            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@FreeBSD.org
          Reporter: jilles@FreeBSD.org
                CC: bugs@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 corrup=
ted
("sh: something=3D: parameter not set").

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-233585-227>