Bash readlines how to
Method 1
for read -r line
do
echo $line
done < input_file.txt > out_file.txt
Method 1
file=$(cat input_file.txt)
for line in $file
do
echo $line
done < input_file.txt > out_file.txt
Links
https://www.geeksforgeeks.org/bash-scripting-how-to-read-a-file-line-by-line/