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