I created the following file called birthday
, which contains the following strings:
Happy Birthday
Happy Birthday
Happy Birthday
when I use the command cat birthday
the shell will output the text string with the line spacing
Happy Birthday
Happy Birthday
Happy Birthday
when I try to declare a variable like this - and echo it back everything is truncated on a single string. How do I keep the spacing and pass it to a variable:
birthday=$(cat birthday) && echo $birthday
Output:
happy birthday happy birthday happy birthday