I am trying to understand input redirection in combination with process substituation. I am using bash
3
An example with tr
is the following
$ tr "o" "a" <(echo "Foo")
tr: extra operand `/dev/fd/63'
Try `tr --help' for more information.
I think I understand why this does not work. The process substitution <( )
creates a file descriptor, where tr
only reads from standard input.
How can I make it work with proper redirection?
I know that I could simply use pipes:
$ echo "Foo" | tr "o" "a"
Faa
However, I am trying to get a better understanding. I tried some thing with the help of man bash
, by using <&
, but I don't really know what I am doing.
How can I use process substitution properly using tr
?