Question: Write an awk program that works as below. It takes the name of a data file as parameter. The file is the output of the

Write an awk program that works as below.

It takes the name of a data file as parameter. The file is the output of the command

ls l | tail n +2 >lsfile

Here is a sample content.

-rw-r--r-- 1 cfs264sp170225 cfs264sp1702 21 2017-04-16 d1

drwxr-xr-x 2 cfs264sp170225 cfs264sp1702 4096 2017-04-16 dir1

-rw-r--r-- 1 cfs264sp170225 cfs264sp1702 181 2017-04-16 lsfile

-rwxr-xr-x 1 cfs264sp170225 cfs264sp1702 179 2017-04-16 p1

-rwxr-xr-x 1 cfs264sp170225 cfs264sp1702 14 2017-04-16 p2

-r--r-xr-x 1 cfs264sp170225 cfs264sp1702 828 2017-04-16 signindata

-rw-r--r-- 1 cfs264sp170225 cfs264sp1702 210 2017-04-16 x

The program prints (exactly once) an introductory text stating what it will do.

The program prints the names of all files that were last updated on April 25, 2017.

The program prints the number of files (from Step c) and total space occupied by the files (again, Step b) exactly once.

For example, here is a possible display, which is for some imaginary data. Use the color codes to match items (b), (c), and (d) above to the display below.

Here is the list of files updated on April 25, 2017

file1

logindata

p1.pl

p2.c

Total space occupied by the above 4 files is 826.

The program must be exclusively in awk and must be executable from the command line assuming access permissions are set. If you use additional Linux commands or a different language, you will not receive any credit for this problem.

Here is an example of how the program is invoked.

$ ./p3 lsfile

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!