Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

2. How do these vengeful heroes exorcise their daemons?

Answered: 1 week ago