Posted By

sanjivarunsahayamhotmailcom on 12/23/08


Tagged

file Bash read


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

sulfurito
ascarion


Read a file line by line


 / Published in: Bash
 

Reads a linux file, line by line

  1. #!/bin/sh
  2. while read LINE
  3. do
  4. echo "processing $LINE"
  5. done < your_input_file
  6.  
  7. An example of your_input_file would be:
  8.  
  9. one
  10. two
  11. three
  12.  
  13. Each line in your_input_file will be read into LINE.

Report this snippet  

You need to login to post a comment.