Created
October 18, 2012 04:46
-
-
Save drwilco/3909900 to your computer and use it in GitHub Desktop.
I did something with bash coproc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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