Clear explanation of default value expression

This commit is contained in:
Andrey Samsonov 2015-05-02 16:21:03 +04:00
parent 7f1c4293e4
commit 6848f45ebe

View File

@ -64,7 +64,8 @@ echo ${VARIABLE:0:7}
# Default value for variable # Default value for variable
echo ${FOO:-"DefaultValueIfFOOIsMissingOrEmpty"} echo ${FOO:-"DefaultValueIfFOOIsMissingOrEmpty"}
# This works for null (FOO=), empty string (FOO=""), zero (FOO=0) returns 0 # This works for null (FOO=) and empty string (FOO=""); zero (FOO=0) returns 0.
# Note that it only returns default value and doesn't change variable value.
# Builtin variables: # Builtin variables:
# There are some useful builtin variables, like # There are some useful builtin variables, like