mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Merge pull request #1080 from kryzhovnik/bash/clear-variable-default-value
Clear explanation of default value expression
This commit is contained in:
commit
7bc99fcaf4
@ -65,7 +65,8 @@ echo ${VARIABLE:0:LENGTH}
|
||||
|
||||
# Default value for variable
|
||||
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:
|
||||
# There are some useful builtin variables, like
|
||||
|
Loading…
Reference in New Issue
Block a user