Link Search Menu Expand Document

Pipes

Other times, it is useful to provide the output of a program as the input of another program. The syntax [process A] |[process B] tells your shell to pipe the output of process A to the input of process B. In other words, the output of program A becomes the input of program B.

Modify your shell so that it supports pipes between programs. You can assume there will always be spaces around the special character |.

You must support an indefinite number of pipes in series, as seen in the example below.

[process A] | [process B] | [process C]