somecommand ${PROG:+-c} ${PROG}Now, I know that ${FOO-bar} will be replaced with the value of $FOO if it is currently set or "bar" if it's not. That much I learned many years ago, but this usage of "+" was new to me. After some testing, I found that "+" substitutes the following text if and only if the variable is set, otherwise it substitutes nothing. Thus if $PROG were set to "foo", the above text would execute:
somecommand -c fooBut if $PROG were not set, then somecommand would be run with no arguments at all. Very slick!
How I managed to go over 20 years without learning that, I'm unsure (then again, perhaps I've learned and forgotten it...)