June 2017
Beginner
502 pages
11h 26m
English
The pipe is a classic example of inter process communication: it passes the stdout of a process to the stdin of another process:
zarrelli:~$ ls -lah | wc -l35
In this example, we just listed the content of the current directory and fed the output as the stdin of the wc utility, which counted how many lines there were in data just fed in. The command after the pipe runs in a subshell, so it will not be able to return any modified value to the parent process; and if one of the commands in the pipe aborts somehow, this leads to the so-called broken pipe and the execution of the pipe stops.
Read now
Unlock full access