When I try to refer to two process substitution pipes in a bash function, only the first one referenced works. The second one gives a "bad file descriptor" error like so:
$ foo(){
> cat "$1"
> cat "$2"
> }
$ foo <(echo hi) <(echo bye)
hi
cat: /dev/fd/62: Bad file descriptor
$
It appears that the second pipe is dropped once one is referenced, but a) I cannot seem to confirm this behavior in any documentation and b) I wish it wouldn't. =)
Any ideas on what I'm doing wrong? FWIW I'm doing this to make a wrapper to use Mac OS X's FileMerge graphical diff tool instead of the command line one, which is already happy to work with multiple pipes from the command line.
-Rob