Add the program “pipe”mob
commit1969b277a3c88c8729542d4d85a4acc46d4ce812
authorff <_ff@tuta.io>
Fri, 22 Dec 2017 13:10:35 +0000 (22 14:10 +0100)
committerff <_ff@tuta.io>
Fri, 22 Dec 2017 13:10:35 +0000 (22 14:10 +0100)
tree11472f168b8856a0d4abb89a30750d1daf71afde
parent547d0e7f77f91bb43a880f70e98efd92bf68b68e
Add the program “pipe”

The program “pipe” spawns a process for each argument,
except the last, which reuses the parent process.
All these processes are connected by pipes
such that the process i reads from i−1 and writes into i+1.
The first process has its stdin not redirected;
the last process has its stdout not redirected.
Each process execv()s into minish-eval,
passing the corresponding argument to it.
“pipe a b c” does what “a | b | c” does in sh,
except that, with pipe,
the process for “a” and for “b” are children of the process for “c”,
that is a child of the shell;
in “a | b | c“, all three process are children of the shell.
Devember/log22.txt [new file with mode: 0644]
src/minish-eval.c
src/pipe.c [new file with mode: 0644]
src/words.h