Question: Write a bash shell script, deleteFilesWithZeroLength.sh, that removes all zero length ordinary files in the directory passed as an optional argument. If you do not

Write a bash shell script, deleteFilesWithZeroLength.sh, that removes all zero length ordinary files in the directory passed as an optional argument. If you do not specify the directory argument, the script uses the present working directory as the default argument. Do appropriate exception handling in your script such as: a. If the arguments are more than 1, print out Too many arguments passed. b. If the argument passed is a regular file, print out XXX is regular file. c. If the directory doesnt exist, print out Directory XXX doesnt exist. Be sure to do the appropriate tests on your script without passing any arguments and when a directory is passed as an argument. Once successfully, the script should display Successfully deleted all zero length ordinary files in XXXX.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!