In my Linux Mint 17.2,/etc/bash.bashrc I see the following:
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
This is the first token reference debian_chroot.
Why does this code use ${debian_chroot:-}instead of just $debian_chroot?
Bash Shell parameter extension says:
$ {option: -word}
If the parameter is not specified or is null, the word is replaced. Otherwise, the parameter value will be replaced.
Here the word "null" is null, so why bother with replacing zero with null?
source
share