Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a bash script that accepts two command-line parameters: (1) a directory name, either absolute or relative, and (2) a size in bytes. For a

Write a bash script that accepts two command-line parameters: (1) a directory name, either absolute or relative, and (2) a size in bytes. For a valid directory, you will print out the list of files along with the size (in bytes) of each file only for those files whose size is greater than or equal to the size specified by the user in the command-line.

Your script must adhere to the following requirements:

If the user enters too few or too many arguments, you are to display an appropriate usage statement and terminate the program.

Since the directory given in the command-line may be absolute or relative, you must check that it is a valid directory. If the directory is not valid, you will print out an error message and terminate the program.

You must implement and use at least one non-trivial function in your bash script that accepts at least one parameter.

You must use at least one non-trivial sed or gawk command within your script. For use with these commands, you may wish to redirect some output from your script to a file called minor3.tmp and apply your sed and/or gawk command.

If no files match your criteria for the size of the file, you will print out some indicator that no files matched your criteria.

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

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions