Go-routines in bash.
Using import.bash
import:use github.com/reconquest/coproc
See reference at REFERENCE.md.
coproc:run bc_proc "bc"
coproc:get-stdin-fd "$bc_proc" stdin
coproc:get-stdout-fd "$bc_proc" stdout
coproc:get-stderr-fd "$bc_proc" stderr
echo "1+1" >&$stdin
read -u $stdout result
Also, stdin can be passed on creating coprocess:
coproc:run bc_proc "bc" <<< "1+4"
coproc:get-stdout-only "$bc_proc" # will output 5