I was looking for a quick icon POSIX shell, which performs the inverse expression ${VARIABLE:+word}"use of alternative values" .
That is, when VARIABLE is null or unset, I want a word, but when VARIABLE is not null, I want null.
For example, if I have a shell variable FLAG_VERBOSE, I can easily make ordinary silent commands more verbose if this variable is non-zero:
some_quiet_cmd ${FLAG_VERBOSE:+ --verbose} arg arg arg ...
However, when I have a regular chat command, I want to suppress its normal chatter when FLAG_VERBOSE is not set by setting an argument:
if [ "$FLAG_VERBOSE" ]; then
CHATTINESS=
else
CHATTINESS=--quiet
fi
some_chatty_cmd $CHATTINESS arg arg arg ...
? , ${VARIABLE:!word} . (, " "?)