Unix read command with option -d and IFS variable combination
shell, unix
Solution
`IFS` is used when you're reading several variables with `read`:
$ echo foo:bar:baz | (IFS=: read FOO BAR BAZ; echo $FOO; echo $BAR; echo $BAZ)
foo
bar
baz
Whereas, the `-d` option specifies what your line separator for `read` is; `read` won't read beyond a single line:
$ echo foo:bar:baz%baz:qux:quux% | while IFS=: read -d% FOO BAR BAZ; do echo ---; echo $FOO; echo $BAR; echo $BAZ; done
---
foo
bar
baz
---
baz
qux
quux
Problem
Looking forward to understand the behavior of read -d when it comes along with IFS variable ``` $ cat f1 a:b:c d:e:f $ while IFS= read -d: ; do echo $REPLY; done < f1 a b c d e $ while IFS=: read; do echo $REPLY; done < f1 a:b:c d:e:f ```