Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CSC3320 System Level Programming Lab Assignment 4 - Part 1 (In- Lab) Instructor: Yuan Long Purpose: Practiccs on the regular expressions and grep family commands
CSC3320 System Level Programming Lab Assignment 4 - Part 1 (In- Lab) Instructor: Yuan Long Purpose: Practiccs on the regular expressions and grep family commands to proccss texts in files. Note: Please follow the instructions below and write a report by answering the questions and upload the rport (named as Lab4_P1_FirstNamcLastName.pdf or Lab4 FirstNameLastName.doc) to the folder "Lab4-Part InLab" of the Dropbox in the iCollege system add the lab ass t NUMBER and your NAME at the top of r file s a) Display the pathname of your current directory b) Move up one levcl to parent dircctory c) Move to the root directory d) Go hack to your home directory c) Print thc content of the filc test.txt in your home directory onto the screen. f) Rename myfilel as myfile2 (assuming both files are in the home directory). Text AB Basic Regular Expression Match? VB Xhellothisis30 AaBbCc,AaBbCc A bcd 3. Open your terminal and connect to snowball server. Change your directory to your home directory (cd ), and then create a new directory named as "Lab4" (mkdir Lab4). After that, go to directory Lab4 (cd Lab4) and please download the file "CSC Course.txt" by the following command (internet access required): Optional Part (not for grading): 1) $ sed-E-n 's/ (CSC13[0-9](3)) {.*)/\1/p. SC-Course . txt Attach a screenshot of the output and what is the functionality of the command. cp home/ylog/public/csc Course.txt CSC Course.txt Be sure t succeeds using "ls" to see the file name "CSC_Course.txt" listed. 2) $ awk -FCSC0-1/print CSC Course.xt grep and egrep can read a file and filter out the lincs not containing the matches of the regular expression defined under the pair of sngle Attach a screenshot of the output and what is the functionality of thc command. 3) $ id-9114,, (H)(..)3/p' sed Attach a screenshot of the output and what is the functionality of the command -E -n 's/ (CSC csc-course . txt Note: marks a single space. 1) Smore CSC Course.txt Functionality: Check the content of "CSC_Course.txt" using more. Note: When viewing the file, you may need to use command f (forward one screen), b (backward one screen) and q(quit). 4) $ 's/CSC![0-914) (1-1)(.*)/\3/p' sed -E CSC-Course . txt1 -n Attach a screenshot of the output and what is the functionality of the command 2) Sgrep 'CSC 3320' CSC Course.txt Not: there is a single space betwen "CSC" and "3320" Functionality: Output the lines containing the string "CSC 3320"(search the course the number of which is "CSC 3320") 3) Sgrep-i CSc 3320' CSC_Course.txt Functionality: Output the lines containing the string "CSC 3320 while ignoring case (scarch the information related to CSC3320) 4) S grep 'CSC 3' CSC Course.txt Describe what is the functionality of the command. 5) egrep CSC 31CSC 1' csc course.txt Attach a screenshot of the output and describe what is the functionality of the command 6) S grep 'CSc.*PROGRANMING' CSC_Course.txt Describe what is the functionality of the command. 7) grep *CSC. *PROGRAMMINGS CSC_Course.txt Attach a screenshot of the output and describe what is the functionality of the command. 8) grep 'CSC. *C++' CSC_Course.txt Describe what is the functionality of the command. CSC3320 System Level Programming Lab Assignment 4 - Part 1 (In- Lab) Instructor: Yuan Long Purpose: Practiccs on the regular expressions and grep family commands to proccss texts in files. Note: Please follow the instructions below and write a report by answering the questions and upload the rport (named as Lab4_P1_FirstNamcLastName.pdf or Lab4 FirstNameLastName.doc) to the folder "Lab4-Part InLab" of the Dropbox in the iCollege system add the lab ass t NUMBER and your NAME at the top of r file s a) Display the pathname of your current directory b) Move up one levcl to parent dircctory c) Move to the root directory d) Go hack to your home directory c) Print thc content of the filc test.txt in your home directory onto the screen. f) Rename myfilel as myfile2 (assuming both files are in the home directory). Text AB Basic Regular Expression Match? VB Xhellothisis30 AaBbCc,AaBbCc A bcd 3. Open your terminal and connect to snowball server. Change your directory to your home directory (cd ), and then create a new directory named as "Lab4" (mkdir Lab4). After that, go to directory Lab4 (cd Lab4) and please download the file "CSC Course.txt" by the following command (internet access required): Optional Part (not for grading): 1) $ sed-E-n 's/ (CSC13[0-9](3)) {.*)/\1/p. SC-Course . txt Attach a screenshot of the output and what is the functionality of the command. cp home/ylog/public/csc Course.txt CSC Course.txt Be sure t succeeds using "ls" to see the file name "CSC_Course.txt" listed. 2) $ awk -FCSC0-1/print CSC Course.xt grep and egrep can read a file and filter out the lincs not containing the matches of the regular expression defined under the pair of sngle Attach a screenshot of the output and what is the functionality of thc command. 3) $ id-9114,, (H)(..)3/p' sed Attach a screenshot of the output and what is the functionality of the command -E -n 's/ (CSC csc-course . txt Note: marks a single space. 1) Smore CSC Course.txt Functionality: Check the content of "CSC_Course.txt" using more. Note: When viewing the file, you may need to use command f (forward one screen), b (backward one screen) and q(quit). 4) $ 's/CSC![0-914) (1-1)(.*)/\3/p' sed -E CSC-Course . txt1 -n Attach a screenshot of the output and what is the functionality of the command 2) Sgrep 'CSC 3320' CSC Course.txt Not: there is a single space betwen "CSC" and "3320" Functionality: Output the lines containing the string "CSC 3320"(search the course the number of which is "CSC 3320") 3) Sgrep-i CSc 3320' CSC_Course.txt Functionality: Output the lines containing the string "CSC 3320 while ignoring case (scarch the information related to CSC3320) 4) S grep 'CSC 3' CSC Course.txt Describe what is the functionality of the command. 5) egrep CSC 31CSC 1' csc course.txt Attach a screenshot of the output and describe what is the functionality of the command 6) S grep 'CSc.*PROGRANMING' CSC_Course.txt Describe what is the functionality of the command. 7) grep *CSC. *PROGRAMMINGS CSC_Course.txt Attach a screenshot of the output and describe what is the functionality of the command. 8) grep 'CSC. *C++' CSC_Course.txt Describe what is the functionality of the command
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started