Return to Snippet

Revision: 6989
at June 30, 2008 04:08 by chaitanya


Initial Code
Hi, 
I am trying to loop through the lines of a file in shell. The code I am using is

#!/usr/bin/ksh
for line in `cat /tmp/file1.txt`
do
        echo $line
done

Intead of getting the output in lines , i am getting word by word.

What may be the problem ?

Thanks,
chaitanya

Initial URL

                                

Initial Description

                                

Initial Title
looping through lines in a file in shell

Initial Tags

                                

Initial Language
Textpattern