mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-24 17:49:36 +01:00
TIL: Echoing a multiple line variable
This commit is contained in:
parent
f07edb58d5
commit
871f28d44c
3
bash-scripting/echoing-a-multiple-line-variable.md
Normal file
3
bash-scripting/echoing-a-multiple-line-variable.md
Normal file
@ -0,0 +1,3 @@
|
||||
If you are wondering why `echo` doesn't print the output on multiple lines, make sure there is `"` around your variable.
|
||||
|
||||
> The difference is that the double-quoted version of the variable (echo "$RESULT") preserves internal spacing of the value exactly as it is represented in the variable — newlines, tabs, multiple blanks and all — whereas the unquoted version (echo $RESULT) replaces each sequence of one or more blanks, tabs and newlines with a single space.
|
Loading…
Reference in New Issue
Block a user