Question: Filtering, Text Processing, and Compiling Programs PART 1 : awk. Open a new terminal window on your Linux system. Type in ps and observe the

Filtering, Text Processing, and Compiling Programs
PART 1: awk.
Open a new terminal window on your Linux system.
Type in ps and observe the output.
Type in ps | awk '{print}' and observe the output. It shouldn't impress you because it gave you the same output as the much shorter command in step 2 above, with the addition of showing awk as a process.
Type in ps | awk '{print $0}' and observe the output. It should be the same as step 3 above.
Now try this: ps | awk '{print $1}'
Then this: ps | awk '{print $2}'
Observe the output of steps 5 and 6 and try to determine what is going on with the output (i.e. what is awk doing?).
Take a screenshot of the commands and output of steps 2-7. Name it lab_7_screenshot_1.
Type in man awk and review the manual page entry.
Type in clear.
Type in cat /etc/shells and observe the output.
Type in awk -F "/"'/^\//{print $NF}'/etc/shells and observe the output and compare it to the output of step 11 above.
Type in awk -F "/"'/^\//{print $NF}'/etc/shells | sort -u and observe the output and compare it to the output of step 12 above.
Take a screenshot of the commands and output of steps 11-13. Name it lab_7_screenshot_2.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!