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 and shell scripting languages here.

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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-27-2005
moon14 moon14 is offline
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..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0