Created
April 24, 2019 12:34
-
-
Save jrelo/b18d79f24aeea1d0349da365d9473b7c to your computer and use it in GitHub Desktop.
coproc usage
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
coproc cat # Start cat in background | |
echo Hello >&${COPROC[1]} # Say "Hello" to cat | |
read LINE <&${COPROC[0]} # Read response | |
echo $LINE # cat replied "Hello"! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment