Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in Linux. Need help with the questions and what to write for the commands. Thank you in advance! CSC3320 System Level Programming Lab

This is in Linux. Need help with the questions and what to write for the commands. Thank you in advance!

image text in transcribed

image text in transcribed

image text in transcribed

CSC3320 System Level Programming Lab Assignment 4 - Part 2 (Post-Lab) Purpose: Practices on the grep. fgrep. egrep, sed, awk, and sort commands for text processing. Note: Please follow the instructions below, and write a report by answering the questions and upload the report (named as Lab4_P2_FirstNameLastName.pdf or doc) to the folder "Lab4_P2" of the Dropbox in the iCollege system. Please add the lab assignment NUMBER and your NAME at the top of your file sheet. The following table is from Wikipedia. It shows the eleven highest mountains in Georgia. Brasstown Bald, (summit),4784 feet,Union County Rabun Bald, (summit),4696, feet, Rabun County Dick's Knob, (summit),4620, feet, Rabun County Hightower Bald, (summit),4568,feet, Towns County Wolfpen Ridge, (ridge high point),4561, feet,Towns and Union Counties Blood Mountain, (summit),4458, feet,Union County Tray Mountain, (summit), 4430, feet,Towns County Grassy Ridge, (ridge high point),4420, feet, Rabun County Slaughter Mountain, (summit),4338 feet,Union County Double Spring Knob, (summit),4280, feet, Rabun County Coosa Bald, (summit),4280, feet,Union County In above table, each line contains 5 fields separated by comma. Open your terminal and connect to snowball server. After that, go to directory Lab4 (cd -Lab4) and please download the file " mountainList.txt" by the following command (internet access required): /home/yye10/public/mountainList.txt mountainlist.txt Be sure it succeeds using ls to see the file name "mountainList.txt listed. cp 1) Use grep to print all lines where the mountains are at Towns or Union County. 1 Sample Output Brasstown Bald , summit), 4784, feet, Union County Hightower Bald, (sunnit),4568, feet, Towns County Wolfpen Ridge, Tridge high point), 4561, feet, Towns and Union Counties Blood Mountain, summit),4458, feet, Union County Tray Mountain, summit), 4430, feet, Towns County slaughter Mountain, (summit), 4338, feet, Union County Coosa Bald, sunnit), 42Be, feet, Union County 2) Use wc and grep to count the number of mountains located at Rabun County. Hint: please use pipe. Sample Output 3) Finish task 2) by using only grep. Hint: open the manual page of grep, and check -c option. 4) A. Type command sed 's/ridge high point/r.h.p./p' mountainList.txt and execute it. Then attach a screenshot of the output. B. Type command sed -n 's/ridge high point/r.h.p./p' mountainList.txt and execute it. Then attach a screenshot of the output. C. Open the manual page of sed and describe what does -n do in sed? D. Describe what does the sed command in (B) do? 5) Use sed to remove the leading spaces in "mountainList.txt" and print out the processed lines. 6) Finish task 5) and save the output to file "newList.txt". 7) Use sed to list the lines beginning with white spaces in "mountainList.txt". Sample Output Brasstown Bald, (summit), 4784, feet, Union County Hightower Bald, (summit), 4568, feet,Towns County Bload Mountain, (summit), 4458, feet, Union County Grassy Ridge, fridge high point), 4420, feet, Rabun County

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_2

Step: 3

blur-text-image_3

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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Develop the first few steps of the project plan.

Answered: 1 week ago