Skip to content

Instantly share code, notes, and snippets.

@jrelo
Created April 24, 2019 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrelo/b18d79f24aeea1d0349da365d9473b7c to your computer and use it in GitHub Desktop.
Save jrelo/b18d79f24aeea1d0349da365d9473b7c to your computer and use it in GitHub Desktop.
coproc usage
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