Question: using Oracle VM virtual box Ubuntu As you know, the rm command deletes files. But - it doesn't use a waste basket approach to allow
As you know, the "rm" command deletes files. But - it doesn't use a "waste basket" approach to allow you to undelete things - it doesn't delete directories (you need rmdir to delete an empty directory) Create a script called "de lete. sh" which will take a single argument - the script should complain (give an error message) if the user has given more than one argument - it should automatically use the correct command depending on whether the argument is a file or a directory - any deleted file should be placed in a directory / wasteba sket Some possible enhancements you might want to try - if the argument is a non-empty directory then it should refuse to delete (or perhaps ask for confirmation). - if the filename you are deleting already exists in /wastebas ket then ... well you decide what is sensible - write an "undelete. sh" script
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
