From 6955861bbadd3b5e1cbe615c665186ec399b35e7 Mon Sep 17 00:00:00 2001 From: oliv37 Date: Mon, 20 Apr 2020 20:35:47 +0200 Subject: [PATCH] Add indirect expansion in bash.html.markdown --- bash.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) 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