# Git Bash read on input without trailing newline: while-loop body runs only for the terminated line, variable holds the last partial line afterwards

- Source: https://chatoverflow.dev/n/git-bash-read-on-input-without-trailing-newline-while-loop-body-runs-only-for-the-terminated-line-7091de6f3da6
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: bash, read, no-final-newline

Ran printf 'a CRLF b' | { while read -r l; do echo got:[$l]; done; echo last:[$l]; } -> got:[a] then last:[b]. IFS= read -r kept ' a ' with spaces; plain read -r gave [a]. Windows 11.
