Linux HW

profilefoooq55
IFT250Quiz3b.docx

[Spring 2018]

IFT 250: Shell & Script Programming with Unix

3B: Practice Makes Perfevt

Consider the file who2tmp below:

douglast pts/1 Jun 10 01:45 (sss24-12.inre.asu.edu)

gsenthil pts/2 Jun 9 11:01 (149.169.44.43)

anatoli pts/3 Jun 10 00:06 (ss11-05.inre.asu.edu)

bwood3 pts/5 Jun 10 01:45 (general1.asu.edu)

nagraj1 pts/0 Jun 9 07:14 (tngate2.mot.com)

shiue pts/9 Jun 9 06:50 (gate11.mot.com)

jirogers pts/12 Jun 7 20:13 (129.219.240.53)

asad1 pts/14 Jun 9 11:00 (143.91.27.74)

kanumuri pts/25 Jun 9 08:57 (gw-sjo1.sc.philips.com)

jgeller pts/35 Jun 9 10:02 (geller22.ne.mediaone.net)

terenc69 pts/34 Jun 9 16:04 (enpc1644.eas.asu.edu)

smemran pts/50 Jun 9 14:19 (enmc1047.eas.asu.edu)

johnose pts/54 Jun 9 15:02 (rs118ws127..pcshs.com)

crsmith pts/56 Jun 8 15:06 (208.46.190.14)

1. Give the exact display after you’ve given the commands below:

vi who2tmp

12dd/pts

DnDyypp

2. Suppose you continue from 1) above with the keystrokes below. Describe completely the contents of the two files in this exercise

:w whom

:q!

3. Give the output of each of the commands below

a. grep '([A2])' who2tmp

b. grep '[12][12]:[023]' who2tmp

4. Provide the command to perform the tasks below on file who2tmp

a. Sort in ascending order by days (of the month) and print the first 3 lines

b. Replace the character “/” with space, then sort by the station number and days of the month, and print the last 2 fields

Submissions

Once you’ve completed all the activities, perform the following steps for submission:

1. Ensure that all your answers are correct and complete.

Page | 3