Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Writing Bash Scripts Write a bash script called minor3.sh that accepts two command-line parameters: (1) a directory name, either absolute or relative, and (2) a

image text in transcribed

image text in transcribed

Writing Bash Scripts Write a bash script called minor3.sh 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 (e.g., HOME/csce3600/sp18) or relative (e.g., ../sp18), 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 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 For use with these commands, you may wish to redirect some output from your 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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What reward will you give yourself when you achieve this?

Answered: 1 week ago

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago

Question

2. Identify conflict triggers in yourself and others

Answered: 1 week ago