CHAPTER 6 Special Unix Features
|>!||same as above, but overrides noclobber option of csh|
||||pipe output to another command|
|<<String||read from standard input until "String" is encountered as the only thing on the line. Also known as a "here document" (see Chapter 8).|
|<<\String||same as above, but don't allow shell substitutions|
An example of output redirection is:
cat file1 file2 > file3
The above command concatenates file1 then file2 and redirects (sends) the output to file3. If file3 doesn't already exist it is created. If it does exist it will either be truncated to zero length before the new contents are inserted, or the command will be rejected, if the noclobber option of the csh is set. (See the csh in Chapter 4). The original files, file1 and file2, remain intact as separate entities.
Output is appended to a file in the form:
cat file1 >> file2
This command appends the contents of file1 to the end of what already exists in file2. (Does not overwrite file2).
Input is redirected from a file in the form:
program < file
This command takes the input for program
To pipe output to another command
command | command
This command makes the output of the first command the input of the second command.