I\'m trying to do something like
read -d EOF stdin
for word in $stdin; do stuff; done
where I want to replace \'EOF\' for an actual repre
To find what a control character is, run
$ cat | od -b
^D
0000000 004 012
0000002
I typed ^V^D after issuing the command, and then RET and another ^D (unquoted) and the result is that EOF is octal 004.
Combining that result with read(1):
$ read -d "$(echo -e '\004')" stdin
foo
bar quuz^Hx
^D
$ echo "$stdin"
foo
bar quux
$ for word in $stdin; do echo $word; done
foo
bar
quux
Yes, I typed ^H above for backspace to see if read(1) did the right thing. It does.