Newline charachter in Ksh-Linux

[LEFT]Hello,
[/LEFT]

I'm trying to create a muliti value shell variable with newlines inside it, So that I can read the values of that variable individually line by line, but KSH seems to be stripping my variable of newlines in LINUX, but UNIX its working fine.

Here's Example :

String = "Hello\n""How R U"

echo "$String" |\
   while read _line
   do
     echo $_line
  done

Output in Unix : Hello

How R U

But In Linux :

Hello\nHow R U

Please help in solving this.

Thanks!!!!

Hello,

Try:

echo -e "$String" |\
...

see man 1 echo

Lo�c.

Sorry , this is not working !!!

Try:

String="Hello\nHow R U"
printf "$String\n" |
while read _line
do
  echo $_line
done

Careful when you assign a value to String: spaces around the =-operator are not allowed..