The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need a simple file based utilty for shell scripts bobk544 Shell Programming and Scripting 4 05-01-2007 03:43 PM
Need Help With Shell scripts holler1 Shell Programming and Scripting 2 07-30-2006 11:43 PM
Difference between writing Unix Shell script and AIX Shell Scripts haroonec AIX 0 04-11-2006 11:27 PM
two simple question on shell scripts.... moxxx68 Shell Programming and Scripting 3 10-15-2004 11:51 AM
simple shell - how to get a parameter typed in a shell script cmitulescu Shell Programming and Scripting 3 12-05-2001 12:04 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-27-2005
Registered User
 

Join Date: Nov 2005
Posts: 1
Talking simple shell scripts

hi everyone...
i'm new to this shell programming and i want help with the following question...
i hope someone can help me ...pls plsssssssssss

==========================================================
the question
==========================================================
A number of users have changed from Windows to Unix and are missing the ability to restore deleted files from the recycle bin. You are going to provide them with a simple set of scripts which will provide a functionally similar feature, but without the irritating Windows 'do you mean this?' dialogue.

In Unix, if you type rm filename the file is deleted. So to cater for those who long for the ability to restore deleted files, this part of the assignment is to write four shell scripts - del, rest, empty and initialise - which will delete a file to the trash can, restore it, empty the trash can or set up the system respectively. The trash can should be a directory called .trash below your home directory. It should be set up by initialise.
The specification for del is del filespec, where filespec is one or more files or directories (you should be able to use wildcards). The deleted files should be moved to the trash can. rest should restore a file to its correct directory from the trash can. If you type rest by itself you should get a list of the files in the trash can in the form nath where n is a number and path is the path from where the file was deleted.

For example,
0:/home/smr/msccw/results
1:/home/smr/msccw/delly
2:/home/smr/msccw/tmp

You can then type rest 1 to restore the file delly. Note if you delete two files with the same name, they should both be saved in the trash can and you should be able to restore either or both of them.
empty will just empty the trash can.
initialise just sets up any directories, files etc that the system needs and should be run once before using the other scripts.
You may assume that the user has a bin directory which is on their PATH
You should make the scripts as robust as possible since they will be used by ex-Windows users. They should be designed to operate from a directory on the users path (e.g. $HOME/bin) You should bundle them up into a self extracting file called safedel. which should be in your bin directory. You should give us read access to this file (Brian and myself). You will lose marks if we can't access it. See the Unix notes for bundle. N.b.Your scripts should be called del, rest, empty and initialise, not some names you would prefer..
Reply With Quote
Forum Sponsor
  #2  
Old 11-27-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Please make sure that you have read our rules. And note:
(6) Do not post classroom or homework problems.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0