The accepted answer to Intersection of two lists in Bash
comm -12 <(ls 1) <(ls 2)
Uses < twice on one command.
Another answer to the same question
sort <(ls one) <(ls two) | uniq -d
Also uses < twice on one command.
What's going on here?
The accepted answer to Intersection of two lists in Bash
comm -12 <(ls 1) <(ls 2)
Uses < twice on one command.
Another answer to the same question
sort <(ls one) <(ls two) | uniq -d
Also uses < twice on one command.
What's going on here?
The shell replaces the <(...) process substitution (hence, "substitution") with the name of a temporary file (could be a symlink to a named pipe; this is somewhat platform-dependent) which gets passed as the actual argument. You can easily see this with a utility which prints its input file names.
bash$ wc -l <(echo foo) <(printf '%s\n' foo bar)
1 /dev/fd/63
2 /dev/fd/62
3 total
bash$ tail <(echo foo) <(printf '%s\n' foo bar)
==> /dev/fd/63 <==
foo
==> /dev/fd/62 <==
foo
bar
bash$ grep '^' <(echo foo) <(printf '%s\n' foo bar)
/dev/fd/63:foo
/dev/fd/62:foo
/dev/fd/62:bar