mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-25 00:06:47 +03:00
Add indirect expansion in bash.html.markdown
This commit is contained in:
parent
55ad60b7dd
commit
6955861bba
@ -88,6 +88,11 @@ echo ${Variable: -5} # => tring
|
||||
# String length
|
||||
echo ${#Variable} # => 11
|
||||
|
||||
# Indirect expansion
|
||||
OtherVariable="Variable"
|
||||
echo ${!OtherVariable} # => Some String
|
||||
# This will expand the value of the OtherVariable
|
||||
|
||||
# Default value for variable
|
||||
echo ${Foo:-"DefaultValueIfFooIsMissingOrEmpty"}
|
||||
# => DefaultValueIfFooIsMissingOrEmpty
|
||||
|
Loading…
Reference in New Issue
Block a user