I have a Linux executable
foo that reads input from fd 0 and writes output to fd 0 (not fd 1). This works just fine for interactive use in the terminal.
From the shell command line, how can I execute this program such that reads from fd 0 come from one file, but writes to fd 0 go into a different file?
The best I can come up with is
$ goo input.txt output.txt | foo where
goo is some helper program, but I don't know of any existing helper program, and I don't even know if the pipe set up by
| is bidirectional.