I have the following file
linux$ cat test.txt toto titi tete tata
Saving cat output to a variable will discard newlines
linux$ msgs=`cat test.txt` linux$ echo $msgs toto titi tete tata
How to save output containing newlines in variables?
source share