What is IFS in while?

What is IFS in while?
Answer
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 = this is a test =
 

Tìm kiếm

Back
Top