What does IFS= do in this bash loop: `cat file | while IFS= read -r line; do … done`
IFS does many things but you are asking about that particular loop. The effect in that loop is to preserve leading and trailing white space in line. To illustrate, first observe with IFS set to nothing: $ echo ” this is a test ” | while IFS= read -r line; do echo “=$line=” ; done … Read more