Skip to content

Instantly share code, notes, and snippets.

@drwilco
Created October 18, 2012 04:46
Show Gist options
  • Save drwilco/3909900 to your computer and use it in GitHub Desktop.
Save drwilco/3909900 to your computer and use it in GitHub Desktop.
I did something with bash coproc
drwilco@guari:~$ pstree -hp 23944
bash(23944)───grep(2832)─┬─grep(2836)
└─yes(2835)
(23944 is the interactive shell that I used to start test.sh)
#!/bin/bash
coproc yes { exec yes; }
coproc grep { exec grep y; } <&${yes[0]}
exec <&${grep[0]}
exec grep y -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment