How to process a file line by line in Bash?

In Bash, how to process a file line by line? The file is a plain text line like input.txt. As an example, the process can be to just print it out.

In Bash to process a file ./input.txt line by line:

while read line ; do
    echo $line
done < ./input.txt

Reference: https://www.systutorials.com/qa/2166/how-to-process-a-file-line-by-line-in-go

Answered by dtivl.

Leave a Reply

Your email address will not be published. Required fields are marked *