Process substitution - tr says 'extra operand /dev/fd/63'
bash, process-substitution
Solution
The way process substitution works is, Bash will replace `<(echo abcd)` with (for example) `/dev/fd/63`, which most common *nix utilities will treat like a filename and open instead of standard input. `tr`, however, does not accept a filename argument; it only takes standard input.
To pass the result of `<(echo abcd)` on standard input, you can use another `<`:
tr -d b < <(echo abcd)
Problem
I'm struggling to understand process substitution. As far as I know, ``` echo abcd | tr -d 'b' tr -d 'b' <(echo abcd) ``` should both give the same output. But the first one works (output is 'acd') but the second says ``` tr: extra operand '/dev/fd/63' ``` Why is this? Doesn't tr just receive 'abcd' through the pipe, and not '/dev/fd/63' as well?