what does ${VARIABLE:-0} stand for?

Hi all,

During reading the code, i met such expressment in a KSH script. I can not figure out what does this mean and don't know how to search it in the web. Could you please check below snippet and let me know what does this mean in a shell script:

VARIABLE=1
if [ ${VARIABLE:-0} -ne 1 ]; then
   . /bin/another_shell.sh
fi

I also met similiar situation before like:

${VARIABLE:-1}
${VARIABLE:-0/} 

(may not exaclty like it, but there is definitely a slash at the end)

Thanks in Adv.

Hi.

It means:

It's described in the man page.

Explanation:-

${parameter-default}, ${parameter:-default}
If parameter not set, use default.

echo ${username-`whoami`}
# Echoes the result of `whoami`, if variable $username is still unset.

${parameter-default} and ${parameter:-default} are almost
equivalent. The extra : makes a difference only when parameter has been declared,
but is null.

:D:D:D:D

Scttn, ahmad.diab,

Great thanks for your clear explanation...