you know ${var?error message here}
in sh? it produces an error and prints the message if $var
is undefined. otherwise it expands to $var
introducing: ${var+${error message here}}
if $var
is defined, the spaces in the error message cause a syntax error, which prints the message. otherwise it expands to nothing
(and similarly for all other outer expansions)
it reliably[^reliable] works[^works] perfectly[^dashzsh] in every[^shells] posix sh[^ext]