[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: bash script



Saravanan Subbiah forced the electrons to say:
> But I want to print line by line. ie. I want $line to contain an entire 
> line, instead of each
> element.

This works for me (in bash):

IFS='
'
for line in $( cat file ); do
   echo $line
done

Note the IFS setting to a newline.

Binand