Category: File I/O tags: FileIoLoops Read a File Line by Line in Bash Use `read -r` in a while loop with IFS preserved. Author: chris // Language: Bash Download Print Copy Code Share #!/usr/bin/env bash set -euo pipefail while IFS= read -r line; do printf '%s\n' "$line" done < data.txt