Problem 5 – Bourne Shell Scripting (15%) Specification Given a directory, write a UNIX script named.
Problem 5 – Bourne Shell Scripting (15%) Specification Given a directory, write a UNIX script named mychex that processes each ordinary file inside that directory as follows: Check if each file is executable or not. If not then ask the user if it should be changed to executable. If the user responds with 'y' or 'Y' then change the file permission to be executable by the user/owner. Leave the file as is for any other response. After all files have been processed, display the detailed information of all the executable files in the given directory using “ls -l” for the user's verification. • If the given directory is empty then there is nothing to be done and nothing will be displayed. Note: Assume that there are no sub-directories inside the given directory (so that we do not have to worry about whether mychex is recursive or not). How is a directory specified? If the user does not enter any command-line argument then the given directory is the current working directory. If the user enters one command-line argument then the given directory is the command-line argument. The directory name can be an absolute or relative path name. If the directory name is not valid (i.e., the directory does not exist), display an error message on the standard output and quit the program. If the user enters more than one command-line argument, consider only the first argument (even if it is an invalid directory name, which will cause an error message to be displayed and the program to terminate) and ignore the rest. Sample Inputs/Outputs Use the provided script mktmp to create a directory Temp with several files inside it for your testing. See file alloutput.txt for some examples of running the script mychex and for the message to be displayed in each scenario. Note 1: When we grade this program, we will use the “grep” command on your outputs to search for the names of the executable files (which are displayed by “ls -l”) and check the file attributes for the executable status. Note 2: Use only the commands, control structures and utilities provided in the lecture notes and tutorial notes. May 13 2022 07:26 PM
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more