Coprocess
Occasionally, a script needs to present input to a program, command, or another script, but not all at once. For instance, you might need to present one item during the beginning of your script, others during the run, and still others at the end. This is generally done by redirecting some input to the appropriate target program. It also can be done through a pipeline. As you saw earlier, a command to the left of the pipe operator presents its output as input to the command to the right of the pipe operator. So, the piping operation is similar to performing redirection, BUT NOT TO A FILE! The redirection is done to the PIPE instead, and the pipe is connected to the next process in the pipeline.
Now consider a situation in which you need ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access