mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
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
11 lines
176 B
Text
11 lines
176 B
Text
# $FreeBSD$
|
|
|
|
unset dummyvar
|
|
msg=`(: ${dummyvar?}) 2>&1`
|
|
r=$?
|
|
[ "$r" != 0 ] && case $msg in
|
|
*dummyvar?* | *?dummyvar*) : ;;
|
|
*)
|
|
printf 'Bad message: [%s]\n' "$msg"
|
|
exit 1
|
|
esac
|