Question : Construct a loop to process each line in a file

How can I construct a  loop in a bash script which loops over the lines in the file. On each iteration of the loop I want to read the line into some variable.

Answer : Construct a loop to process each line in a file

if the lines do not contain whitespace it's just like:

cat file.txt | while read line; do echo $line; done
Random Solutions  
 
programming4us programming4us