cmd bash "cat" behaves differently when is added to variable
by bryn1u from LinuxQuestions.org on (#5MGVK)
Hey guys,
Im trying to use cat which is assigned to variable. But the output of "cat" is differently then from command line, why ?
Code:root@Proton:[~]:#> cat text
dupufufr3
frerfr3
3r
edziopedzio
frwnfru
fjwlfrew
fklwkfw
fkwf
root@Proton:[~]:#> variable="$(cat text)"
root@Proton:[~]:#> echo $variable
dupufufr3 frerfr3 3r edziopedzio frwnfru fjwlfrew fklwkfw fkwfWhy this is interpreted differently ? How can i get the same output as from command line ?
Thank you,
Im trying to use cat which is assigned to variable. But the output of "cat" is differently then from command line, why ?
Code:root@Proton:[~]:#> cat text
dupufufr3
frerfr3
3r
edziopedzio
frwnfru
fjwlfrew
fklwkfw
fkwf
root@Proton:[~]:#> variable="$(cat text)"
root@Proton:[~]:#> echo $variable
dupufufr3 frerfr3 3r edziopedzio frwnfru fjwlfrew fklwkfw fkwfWhy this is interpreted differently ? How can i get the same output as from command line ?
Thank you,