Can anyone please provide me an explanation as to why some Linux expert suggest that we use ${VARIABLE} in Bash scripts? There doesn't seem to be any difference at all.
Say you want to print $VARIABLE
immediately followed by "string"
echo "$VARIABLEstring" # tries to print the variable called VARIABLEstring
echo "${VARIABLE}string" # prints $VARIABLE and then "string"
Bash also supports string manipulation using this syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With