4

I have some scripts which use coproc to control stdout/stdin of subprocesses. Unfortunately, coproc was introduced in Bash 4.0, and on many systems I use, there is an earlier versions of bash.

Are there any alternatives to coproc?

MadHatter
  • 81,580

1 Answers1

6

You can used standard named pipe instead of coproc:

mkfifo in_data out_data

command <in_data >out_data &

exec 3> in_data 4< out_data

echo <some thing here> >&3
read <some variables here> <&4
cuonglm
  • 2,416