I found that when I used a variable to receive the result from a command execution, the newline characters were removed from the variable.
For example, I ran
$ ret=`ls -l`
$ echo $ret
Then, I saw:
total 40 -rw-r--r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk -rw-rw-r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk1
But the output I expected is:
total 40
-rw-r--r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk
-rw-rw-r-- 1 testtrunk testtrunk 0 Dec 13 11:13 pk1
So, the question is, how to keep the newline characters in the variable that receives the command result?
Thanks.