bash - `while IFS= read -r` still not preserving whitespace ... 2013年7月17日 - Just quote your variables: while IFS= read -r p; do echo "$p"; done < file1. Notice that you don't need to use cat as well.