What does '$ mean in bash?
This is bash's process substitution.
The expression <(list)
gets replaced by a file name, either a named FIFO or an entry under /dev/fd
. So to actually redirect input from it, you have to use < <(list)
.
[edit; forgot to answer your second question]
The backticks are called "command substitution". Unlike process substitution, it is part of the POSIX shell specification (i.e., not a bash extension). The shell runs the command in the backticks and substitutes its output on the command line. So this would make sense:
cat < `echo /etc/termcap`
But this would not:
cat < `cat /etc/termcap`
The latter is similar to your example; it tries to use the (complex) output of a command as a file name from which to redirect standard input.
The others have already answered your question very nicely. I'll just add an example to build on them... 99% of the time when I personally use <()
, it's to diff the output of two different commands in one shot. For instance,
diff <( some_command ) <( some_other_command )