Redirection of coprocess input and output
The standard input and output of a coprocess is reassigned to a numbered file descriptor by using I/O redirection.
For example, the command:
exec 5>&p
moves
the input of the coprocess to file descriptor 5
.After this coprocess has completed, you can use standard
redirection syntax to redirect command output to the coprocess. You can also
start another coprocess. Output from both coprocesses is connected to the
same pipe and is read with the read -p command. To stop
the coprocess, type the following:
read -u5