Bash Scripting & Read File line by line - Stack Overflow
The following (save as rr.sh) reads a file passed as an argument line by line: #!/bin/bash while IFS='' read -r line || [[ -n $line ]]; do echo "Text read from file: $line" done < "$1" Explanation: IFS='' (or IFS=) prevents leading/trailing whitespace fro...