Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
A set of Linux shell scripts is required to allow users to ‘remove' files without them really disappearing until the ‘dustbin' is emptied. The three shell scripts required are :-
del <filename> - This script should move the file called <filename> (a full or relative pathname) to the
dustbin directory.
trash [-a] - This script should remove the contents of the dustbin directory.
If the -a option is not used, the script should print the filenames in the dustbin one by one and ask the
user for confirmation that they should be deleted.
Otherwise, If the -a option is used, the script should simply remove ALL files from the dustbin.
restore [-n] <filename> - This script should move the file called <filename> (a full or relative pathname)
back to its original directory.
If the -n option is used, the script should allow the file to be moved to a directory nominated by the user.
2. Relevant commands, code, scripts, algorithms:
bash code
using ubuntu
I used a dustbin directory to keep my deleted files
3. The attempts at a solution (include all code and scripts):
del script
trash script
restore script 4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Edinburgh Napier University , Edinburgh , UK , Dr Alistair Armitage , CSN08101 Systems and Services
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
***********************************
I am just looking to see if there is anything I can do to improve the scripts?
Any help would be appreciated
Last edited by Scott; 12-07-2010 at 03:11 PM..
Reason: Added code-tags and indentation for readability
I use a Mac running OSX El Capitan = UNIX user the hood. After rearranging files on an external hard drive, I ended up with a folder in the trash containing a file called "~INITPicker 2.0". I cannot empty the trash, and so delete the file. I even tried terminal, using the rm file command and... (38 Replies)
Hi there is anyone able to show me two scripts for a delete and a restore command.
Delete - move a file to a dustibin directory that i have created. check to see if that file exsits first in the dustbin if so delete the file before moving the new one.
Restore - return the file to its... (1 Reply)
I have an amount of folders and I want to delete only the empty ones. But I have more than 200 empty folders, so I would preffer do not delete one by one... I know it is possible, but I don't know how. I've tried with the size, using 'du' command, and saving the result in a file. After that, I made... (3 Replies)
I have a BIG problem...
I host a public (Debian) repository on Cydia (for jailbroken iphones). I use my home Mac running Ubuntu in VMWare Fusion. For the repository, I have to have 5 items in a folder to make it 'live:'
1. deb_files folder (to hold my Debian packages)
2. Packages file
3.... (0 Replies)
you are to write scripts for a customer that would require a system enable the backing up of files and directories. The script should (these names should be used):
1. INITIALISE: Initialise the directory for the backup(called backup and should be in the home directory) and any other... (1 Reply)
Anyone who could help me with those three commands, i'm really new in cshell script so please be understandable..
Need to demostrate those three commands
del
trash (incl -ai) i that you will be asked to confirmed that they can be deleted
a to move all those files from dustbin
and to... (2 Replies)
abc#
abc#this is a test
abc#this is a test to delete
abc#
xyz#
xyz#this is a test two
xyz#
In the above example '#' is common. How to do delete the emply lines. In specific to observe the output as:
abc#this is a test
abc#this is a test to delete
xyz#this is a test two
.
.
.
. (5 Replies)
Hello
i am trying to empty the trash using rm or rmdir command . Any idea how to delete the folders and subfolders using one of the above commands?
Thank You (2 Replies)
I trashed Adobe Acrobat (not Acrobat Reader today) because Adobe screwed up my licensing; their solution was to issue me a new serial number (thanks, guys). Anyhoo, I can't delete all of the Acrobat folder from my trash in OS X, nor can I move it out of the trash (it just copies). Any suggestions?... (4 Replies)