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...)
Great, well! Interestingly written review. Using business solutions it is the best way to receive software development.
ReplyDeleteA lot of thanks for your fresh update. Casino affiliates always look for casino affiliate programs to increase their revenue income from best casinos or poker rooms.
ReplyDeleteSuch interesting info reviews. Take into consideration cheap homeowners insurance rates
ReplyDeleteThanks for sharing with us great info. For auto owners who is looking for new cars, compare autoquotes from top auto insurance companies.
ReplyDelete