Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Perl script that works as below. a) It takes the name of a data file as parameter. This file Is the output of

image text in transcribed

Write a Perl script that works as below. a) It takes the name of a data file as parameter. This file Is the output of the command ls -1 | 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 cfs264sp 170225 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 cfs264spi 70225 cfs264sp1702 828 2017-04-16 signindata -rw-r--r-- 1 cfs264sp 170225 cfs264sp1702 210 2017-04-16 x b) The script examines each line of the file (given as parameter) and uses the information so read to determine the total space occupied by the entries listed in the file. The program prints nothing else. Here is a possible output. Total space = 5593 bytes The program must be exclusively in Perl and must be executable as shown below from the command prompt assuming

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions