Posted By

chaitanya on 06/30/08


Tagged


Versions (?)

looping through lines in a file in shell


 / Published in: Textpattern
 

  1. Hi,
  2. I am trying to loop through the lines of a file in shell. The code I am using is
  3.  
  4. #!/usr/bin/ksh
  5. for line in `cat /tmp/file1.txt`
  6. do
  7. echo $line
  8. done
  9.  
  10. Intead of getting the output in lines , i am getting word by word.
  11.  
  12. What may be the problem ?
  13.  
  14. Thanks,
  15. chaitanya

Report this snippet  

You need to login to post a comment.