Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started