Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a sed script that works as below. It takes the name of a data file via input redirection. The file used for redirection is

Write a sed script that works as below.

It takes the name of a data file via input redirection. The file used for redirection is the output of the command

ls l | tail n +2 >lsfile

Here is a sample content of the file.

-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

It prints the records of all files that were last updated on April 25, 2017. It must print nothing else.

For example, here is a possible display, which is cooked up because April 25 is a future date.

-r-xr-xr-x 1 cfs264sp170225 cfs264sp1702 40 2017-04-25 abcd

-r--r-xr-x 1 cfs264sp170225 cfs264sp1702 28 2017-04-25 efgh

-rw-r--rw- 1 cfs264sp170225 cfs264sp1702 140 2017-04-25 pqr

The program must work when executed as below.

$ ./p4< name-of-file-that-contains-ls-l-info>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions