Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Perl Program: You must write a Perl program that will provide a listing of files in a directory. The files must be listed in sorted

Perl Program:

You must write a Perl program that will provide a listing of files in a directory. The files must be listed in sorted order by the file name.

By default, the program displays only file names.

By default, the program lists the files in the current directory.

The program must provide the following command line options to the user:

d [directory]: This option allows the user to specify a directory or no directory name. If the -d option is provided without specifying a directory name, list your current directory (~student user name/itec400/homework). The output shall be displayed using the following column headers: File Name Size Owner Group

l: This option instructs the program to display a long listing. The output shall display the following column headers: File Name Size Owner Group

The user selects no options. List the file names under your current directory (~student user name/itec400/homework). The output shall display the following column header: File Name

The script file name must be: listdir.pl

Sample output:

User selects no options (provide column header and list file names): > listdir.pl File Name 4th 4th_log 4th.old 4th.old.2 address.cpp address.h address.o

User selects -l option (only subset of output isshow): > listdir.pl -l File Name OUTPUT HERE Size Owner Group

User selects -d option. > listdir.pl d File Name Size Owner Group OUTPUT HERE

User selects -d option without specifying a directory name. > listdir.pl d File Name Size Owner Group OUTPUT HERE

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago

Question

=+working on a micro-multinational?

Answered: 1 week ago

Question

=+j Identify the challenges of training an international workforce.

Answered: 1 week ago