Korn shell read */

September 23, 2010 at 13:20:56
Specs: Solaris
Hi,

I need to parse a file that has line like
/* blah blah blah */

When I use
while read LINE
do
echo $LINE
done < filename

My script would return
/* blah blah blah /log /dir....

Why is that? How do I get back /* blah blah blah*/?


See More: Korn shell read */

Report •

#1
September 23, 2010 at 15:43:38
With a variable containing white space, you have to surround that variable - $LINE in this case - with double quotes:

while read LINE
do
   echo "$LINE"
done < filename


Report •
Related Solutions


Ask Question