DOC PREVIEW
GSU CSC 3320 - Homework2

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Homework 2Due : Wednesday, February 9, Email to TAQuestion 1 (15)Describe the meaning for each regular expression below. For each expression, give 3 different examples that match the pattern.a. /^[A-Z]..$/b. /^[A-Z][a-z]*3[0-5]/c. /^[A-Za-z]*[^,][A-Za-z]*$/Question 2: (20) (Grep/egrep exercise)Given the file 'datebook' (you can download it from websitehttp://www.cs.gsu.edu/pan/csc3320/databook.txt) containing the lines ofthe following format: type first-name last-name email-addressdo the following queries:a. Print all lines containing the string CS4520.b. Print all lines where the person's first name starts with J.c. Print all lines that contain .comd. Print all lines containing an uppercase letter, followed by fourlowercase letters, a space and one uppercase letter.Question 3: (20) (sed exercise)Use the file 'datebook', do the following queries:a. Change Dumitru's name to Dima.b. Delete the first 3 line.c. Print all lines where the email address contains @student.gsu.edud. Replace the line containing "CS2010" with "NULL NULL NULL NULL".Question 4: (15) (awk exercise)Use the file 'datebook1' as database from (http://www.cs.gsu.edu/pan/csc3320/databook1.txt). The file containsthe lines of the following format:type first-name last-name email-addressDo the following queries:a. Print all email address.b. Print Dumitru's name and email address.c. Change the type with the following rule:if line number modulo 3 is 1, the type field should be changed toCS4520;if line number modulo 3 is 2, the type field be changed to CS2210;or else keep the original type field;Question 5: (10) (Exercise for transforming files)Write a command pipeline that archives and compresses the contents of a file,and writes the result to a new file. What is the corresponding commandpipeline to take this compressed file and uncompress and extract it toproduce the original file?Question 6: (10) (Exercise for searching files)Write a command pipeline to find files in a directory hierarchy (e.g. yourhome directory) that have the name pattern '*.txt" and compress them.Question 7: (10) (Exercise for sorting files)Write a command pipeline to list files in a directory hierarchy (e.g. yourhome directory) that have the name pattern '*.txt" and sort them by filesize.Question 8: (10) (Exercise for scheduling a command)Write a crontab file to send a greeting message to your mom on Christmas Eve. Show how to run the crontab


View Full Document

GSU CSC 3320 - Homework2

Download Homework2
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework2 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework2 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?