I am facing this situation I do not understand.
I have a file containing three lines. When I just cat
it, it returns the following:
line1
line2
line3
However, when I assign the cat return to a variable like so:
tmp=$(cat myfile )
And echo its content:
echo $tmp
It gives the following:
line1line2line3
Why does it behave like this ?