2 ms·
You might also want to clear IFS if you don't want to trim leading/trailing whitespace (taken from https://mywiki.wooledge.org/BashFAQ/001 https://mywiki.wooled
by ndsipa_pomu 4y ago
You might also want to clear IFS if you don't want to trim leading/trailing whitespace (taken from https://mywiki.wooledge.org/BashFAQ/001 https://mywiki.wooledge.org/BashFAQ/001):
while IFS= read -r line <&9; do
cat > ignoredfile
printf '%s\n' "$line"
done 9< "$file"
("cat" is used as an example of a command eating stdin)