coproc

Bash builtin for creating interactive asynchronous subshells. More information: https://www.gnu.org/software/bash/manual/bash.html#Coprocesses.…

coproc

Bash builtin for creating interactive asynchronous subshells. More information: https://www.gnu.org/software/bash/manual/bash.html#Coprocesses.

coproc { {{command1; command2; ...}}; }

coproc {{name}} { {{command1; command2; ...}}; }

echo "{{input}}" >&"${{{name}}[1]}"

read {{variable}} <&"${{{name}}[0]}"

coproc {{name}} { while read line; do {{command1; command2; ...}}; done }

coproc {{name}} { while read line; do echo "$line" | {{command1 | command2 | ...}} | cat /dev/fd/0; done }

coproc BC { bc --mathlib; }; echo "1/3" >&"${BC[1]}"; read output <&"${BC[0]}"; echo "$output"

Также может быть вам интересно:
LinuxFreeBSDТрюки BashТерминал/Консоль
← conntrack coredumpctl →