Define Unix Process
Starting Other Shells
Parent Child Processes
3 Ways Shell Script
Specify Shell Script
Unix Path Variable
Shell Script Conclusion
Date Command Options
Embedded Command Syntax
Unix File Types
Debugging Shell Scripts
–c option grep - Exercise
The –c option to grep
Practice writing regular expressions and grep commands
This exercise is worth 5 points and is auto-scored.
1. Access the clothes file located in your home directory.
2. Write a
command to list lines containing Black in the clothes file.
3. Write a command to count the number of lines containing the string “pair of shoes” in the clothes file.
4. Write an assignment statement to save the output of the previous command in a variable called count. Use embedded command execution.
First, run the command below to create a variable called item.
$ item=”pair of shoes”
5. Then, write an assignment statement to create a variable called itemcount. This variable will store the number of lines matching “pair of shoes” in the clothes file. Use embedded command execution.