How to read a linux file line by line [Closed]

Report
-
Posts
19532
Registration date
Wednesday October 8, 2008
Status
Contributor
Last seen
June 15, 2019
-
Hi!
thank you for the example

while read line; do echo "$ line \n"; done < file.txt

you should correct the $ line without space, and it works great.
I did it.

while read line; do echo "$line \n"; done < file.txt

thanks!

1 reply

Posts
19532
Registration date
Wednesday October 8, 2008
Status
Contributor
Last seen
June 15, 2019
1,780
thanks for the info

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!