[mdlug] Scripting - Newlines getting clobbered?

Wojtak, Greg GregWojtak at quickenloans.com
Wed Dec 26 15:44:42 EST 2007


>> Any ideas how to keep the newline inside of variables?
>
>Sure, just use quotes, like this:
>
>VAR="`cat data`"
>echo "$VAR"
>
>c

Marvelous!  Worked like a charm.  Now I can ssh over to a server,
grab the data into a local variable and perform operations on it
instead of making several ssh connections to the remote and 
issuing several different commands.  Or even worse, using temp
files (yech!).

Greg



More information about the mdlug mailing list