Looping through a file line by line

suggest change
while IFS= read -r line; do
   echo "$line"
done <file

If file may not include a newline at the end, then:

while IFS= read -r line || [ -n "$line" ]; do
   echo "$line"
done <file

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents