document updated 14 years ago, on Dec 3, 2010
KSH's coprocesses seem like expect, but inside the shell! Awesome.
O'Reilly's book "Learning the Korn Shell", §8.5 "Coroutines", goes over this a little bit.
Examples of their use
Search strings
When looking at existing scripts, look for these strings, as an indicator of where the specific coroutine code is happening:
|&
read -p or, less commonly, read -u
print -p or, less commonly, print -u
} |
| while read VARNAME
>&N where N≥3
<&N where N≥3
Man page
- pd-ksh manpage — look for search strings like:
- "asynchronous"
- "co-process"
- ksh93 — look for search strings like:
- "asynchronous"
- "co-process"
- ksh88 — look for search strings like:
- "asynchronous"
- "co-process"