Overview
In Chapter 5, students learn many new file-processing selection, manipulation, and
transformation commands to put in their expanding toolbox. The pipe operator (|) is
introduced. Students learn how to use selection commands (grep, uniq, comm, diff, and
wc) and manipulation/transformation commands (sed, tr, and pr). Finally, students learn
how to design a file-processing application in a step-by-step process by creating,
testing, and running shell scripts.
Chapter Objectives
• Use the pipe operator to redirect the output of one command to another command
• Use the grep command to search for a specified pattern in a file
Teaching Tips
Advancing Your File-Processing Techniques
2. Use Tables 5-1 and 5-2 to briefly describe the most useful selection and
manipulation/transformation commands.
Using the Selection Commands
1. Mention that UNIX/Linux has another redirection operator: the pipe (|) operator.
2. The following selection commands will be described in this section: grep, diff, uniq,
comm, and wc.
Using the Pipe Operator
1. Use several examples to show how the pipe operator (|) can be used to redirect the
output of one command to the input of another command. Figure 5-1 shows how three