Read a File Line By Line in Bash

#!/bin/bash
input="/path/to/txt/file"
while IFS= read -r line
do
  echo "$line"
done < "$input"

References
https://www.cyberciti.biz/faq/unix-howto-read-line-by-line-from-file/

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.