Name: Anonymous 2022-05-07 9:16
Early on, during the first year of Unix, an ideal was formed for what a Unix program would be: it would receive a number of filenames as command-line arguments, and it would read them. If no filename was given, it would read standard input. It would write its output to standard output. There may be a small number of other fixed command line arguments. The options did not exist. This made it easy to combine programs: the output of one program could be the input of another.
There were of course variations. The
In the example above, the
It was quite powerful. It was also very easy
There were of course variations. The
echocommand read nothing. The
cp,
mvand
rmcommands did nothing. However, the "filter" was the ideal.
$ cat *.txt | wc
In the example above, the
catprogram reads all files with names with a .txt suffix, writes them to its standard output, which is then redirected to the
wcprogram, which reads its standard input (it doesn't have received no file name) to count the words. In short, the above pipeline counts words in all text files.
It was quite powerful. It was also very easy