> Fair enough, but the burning question is HOW?
Here are a few rudimentary examples which should get you started:
program |& # start program as co-process
read -p inputline # read line of data from co-process into variable # inputline
print -p "foo bar" # send data "foo bar" to co-process
anotherprogram <&p >&p # run another program, connecting its # standard input and standard output to co-process
exec 3<&p 4>&p # connect file descriptor 3 to input from co-process and # file descriptor 4 to output to co-process by default
read -u3 inputline # read data from co-process, this time through file # descriptor 3 (comparable syntax for print as well)
program2 |& # now that the prior co-process has been connected to file # descriptors, we can start a second co-process without # the two interfering with each other
Eric Amick