Question: LINUX - I need an awkscript to do the following; 5.4) Please create a file called myloginfile as shown below and then write an awk
LINUX - I need an awkscript to do the following;
5.4) Please create a file called myloginfile as shown below and then write an awk script called mylogincheck to check on file myloginfile to see who spent more than 3 hours on the system and then display those login records. (The last column of the output shown below indicates the time spent on the system).
$ last | grep "Feb 12" | tail -10 > myloginfile
$ cat myloginfile
ics311sp pts/3 73.94.204.99 Mon Feb 12 12:33 - 16:29 (03:56)
ics311sp pts/0 10.10.73.223 Mon Feb 12 12:19 - 12:33 (00:14)
ics311sp pts/6 24.118.156.49 Mon Feb 12 11:19 - 15:22 (04:02)
ics311sp pts/5 50-201-63-178-st Mon Feb 12 11:11 - 11:21 (00:10)
ics311sp pts/4 c-66-41-158-8.hs Mon Feb 12 11:01 - 16:05 (05:03)
ics311sp pts/3 75-168-56-32.mpl Mon Feb 12 10:57 - 12:04 (01:06)
ics311sp pts/0 50-201-63-178-st Mon Feb 12 07:50 - 11:25 (03:34)
ics311sp pts/0 50-201-63-178-st Mon Feb 12 07:30 - 07:50 (00:20)
ics311sp pts/0 50-201-63-178-st Mon Feb 12 07:26 - 07:29 (00:02)
ics311sp pts/0 50-201-63-178-st Mon Feb 12 07:12 - 07:26 (00:13)
$
$ awk f mylogincheck myloginfile
ics311sp pts/3 73.94.204.99 Mon Feb 12 12:33 - 16:29 (03:56)
ics311sp pts/6 24.118.156.49 Mon Feb 12 11:19 - 15:22 (04:02)
ics311sp pts/4 c-66-41-158-8.hs Mon Feb 12 11:01 - 16:05 (05:03)
ics311sp pts/0 50-201-63-178-st Mon Feb 12 07:50 - 11:25 (03:34)
$
a) Please provide your awk script below (8 points):
b) The screenshot (2 points):
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
