One of the best-designed features of shell scripting is the ease of combining many commands or utilities to produce output. The output of one command can appear as the input of another, which passes its output to another command, and so on. The output of this combination can be read in a variable. This recipe illustrates how to combine multiple commands and how its output can be read.
Input is usually fed into a command through
stdin or arguments. Output appears as
stdout. While we combine multiple commands, we usually use
stdin to give input and
stdout for output.
Commands are called as filters. We connect each filter using pipes. The piping operator is "
|". An example is as follows: ...