Read a file line by line

/ Published in: Bash
Save to your folder(s)

Reads a linux file, line by line

Copy this code and paste it in your HTML
  1. #!/bin/sh
  2. while read LINE
  3. do
  4. echo "processing $LINE"
  5. done < your_input_file
  7. An example of your_input_file would be:
  9. one
  10. two
  11. three
  13. Each line in your_input_file will be read into LINE.

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.