Home Linux Bash Shell Scripting How to loop through lines in a file using Bash?
 
 
 

How to loop through lines in a file using Bash?

PDF Print E-mail

Question: How to loop through lines in a file using Bash?

 

Answer:

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

+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!