-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1138
Joachim Ansorg edited this page Oct 31, 2022
·
2 revisions
while read -r line
do
echo "You said: $line"
done <<(cmd)
while read -r line
do
echo "You said: $line"
done < <(cmd)
When redirecting <
from a process substitution <(cmd)
, make sure there is a space between the two <
characters as shown in the example.
With a space cmd1 < <(cmd2)
, is correctly interpreted as "run cmd1, reading stdin from cmd2, without forking for a pipeline".
Without a space, <<
is incorrectly considered a here document, and (cmd2)
is an invalid delimiter token.
None
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!