*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.
A commit references this bug: Author: jilles Date: Wed Nov 28 20:03:54 UTC 2018 New revision: 341164 URL: https://svnweb.freebsd.org/changeset/base/341164 Log: sh: Fix ${param?} default error message If word in ${param?word} is missing, the shell shall write a default error message. So expanding ${param?} when param is not set should write an error message like sh: param: parameter not set This was broken by r316417. PR: 233585 Changes: head/bin/sh/expand.c head/bin/sh/tests/expansion/Makefile head/bin/sh/tests/expansion/question2.0
A commit references this bug: Author: jilles Date: Sun Dec 9 19:14:22 UTC 2018 New revision: 341767 URL: https://svnweb.freebsd.org/changeset/base/341767 Log: MFC r341164: sh: Fix ${param?} default error message If word in ${param?word} is missing, the shell shall write a default error message. So expanding ${param?} when param is not set should write an error message like sh: param: parameter not set This was broken by r316417. PR: 233585 Changes: _U stable/12/ stable/12/bin/sh/expand.c stable/12/bin/sh/tests/expansion/Makefile stable/12/bin/sh/tests/expansion/question2.0