Question: This is UNIX based question: Here, you will write a script named saferm. Its job will be to place a copy of a file into

This is UNIX based question:

Here, you will write a script named saferm. Its job will be to place a copy of a file into a holding directory before deleting it (sort of like the recycle bin concept).

Here is what the script must do:

1. Take one and only one argument at the command line.

Print out an error message if no argument or more than one arguments are provided. Exit the script.

2. Check for the existence of a directory named safermrecycle in your home directory.

If the directory does not exist, create it.

3. Check the argument to be sure that it is a file.

Print out an error message if the argument is not a file. Exit the script.

4. Copy the file indicated by the first argument to this safermrecycle folder.

5. Delete the file.

Check the operation of your script to be sure it works successfully.

Download your script from your server. You may additionally provide any documentation of its operation and how you achieved the solution in a separate Word document.

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!