diff options
author | oliv37 <olivier.boisse@laposte.net> | 2020-04-20 20:35:47 +0200 |
---|---|---|
committer | Andrew Ryan Davis <AndrewDavis1191@gmail.com> | 2020-05-26 18:13:38 -0700 |
commit | 6955861bbadd3b5e1cbe615c665186ec399b35e7 (patch) | |
tree | 0a0a3648957dff65149b5168eb01df79f171f9bb /bash.html.markdown | |
parent | 55ad60b7dd85616719d886e6e273026f82ce72b6 (diff) |
Add indirect expansion in bash.html.markdown
Diffstat (limited to 'bash.html.markdown')
-rw-r--r-- | bash.html.markdown | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index 856db706..407b237b 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -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 |