Bash supports process substitution. This allows you to open a file descriptor for either standard in or standard out for a process. For example, I can open fd 9 to read the output of the ls command:
Now I can
or redirect that fd into another process:
.
I can do that with stdin as well
My question is... is it possible to open
two file descriptors for the process that represent stdin and stdout, so you can write to one, and get the result from the other? Right now, I'm accomplishing the same effect using named pipes for one end and a file descriptor for the other, but then you have to worry about cleaning up your temporary fifos and it's much less secure. Any suggestions?