How to loop through lines in a file using Bash

No Comments
for i in $(cat myFile.txt); do echo $i; done

The above code executes a for loop and then echo’s out each line in the file myFile.txt

Image Credits: Photo by Isis França on Unsplash.

Last Updated On April 07, 2018

Related Articles

No results found

Leave a Reply

avatar
  Subscribe  
Notify of
Menu
Copy link