Loop through lines of a text file

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

Copy this code and paste it in your HTML
  1. for i in $(cat example.txt); do echo $i; done
  3. for i (`cat example.txt`) echo $i
  4. # (Zsh only)

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.