Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have seen a line of shell script as follows:

local soft_upgrade=${3:-false}

What does this mean? I don't know what 3:-false means.

share|improve this question
up vote 5 down vote accepted

No, it's nothing about array, it's a default value in parameter substitution.

If $3 is not set, set soft_upgrade to false, otherwise, set it to $3

share|improve this answer
This also applies when $3 is null, not just when it is unset. – Chris Down Feb 21 '13 at 10:07
Just "false", not "-false", :- is the specific parameter expansion operation. – mr.spuratic Feb 21 '13 at 10:15

Take a look at this article, for me it was really useful:

Variable Mangling in Bash with String Operators

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.