[mdlug] Scripting - Newlines getting clobbered?

Wojtak, Greg GregWojtak at quickenloans.com
Wed Dec 26 14:51:18 EST 2007


I am trying to read a multi-line file into a variable, and the lines are
getting concatenated together in one big line.  So a file that contains

line 1
line 2
line 3
line d
line 6

would look like line 1 line 2 line 3 line d line 6 when I do:

VAR=`cat data`
echo $VAR

Any ideas how to keep the newline inside of variables?

Thanks!

Greg 



More information about the mdlug mailing list