![]() |
![]() |
![]() |
Standard error works much the same way but
uses the "2>" syntax instead of the ">" syntax such as in the
following example which sends error messages from the ls
command to the file error.txt (there is no -U option).
ls -U 2> error.txt Standard input works using the "<" character. Thus, to send a set of pre-saved parameters to a command you might do something like the following
![]() Finally, you should note that you can string input and output so that the following example would save the contents of unsorted.txt in a sorted order in the file sorted.txt
![]() Pipes (pipelines) work much like redirection except that the work strictly on sets of commands. Specifically pipes allow you to send the standard output of one command to another command such as in the following case which sends the direfctory listing to the sort comand which sorts the directory in dictionary order:
![]()
Note that a pipeline can be as long as is reasonable. Thus, you might see a pipeline such as: cat directory_listing | grep .html | sort | more Of course, we will discuss all of these utilities later, but you get the picture. Just think that when you see "X | Y | Z" you should say to yourself "Execute X and send the output to Y. Then send the output of Y to Z."
|