Bash For Loop through lines of a text file

I couldn’t remember how to do this this morning, so I am jotting it down, just in case I forget:

for L in $(cat file-i-want-to-loop-through); do echo $L;  done

Did you like this? Share it:
This entry was posted in Tips and tricks. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *