Creating a saferm that runs like rm


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Creating a saferm that runs like rm
# 1  
Old 11-07-2005
Question Creating a saferm that runs like rm

Hi,

I have a problem with the following. I am trying to learn UNIX and as I am not an expert I don't know how to do the following exercise:

Requirement: Show knowledge of how to use some or all of the following commands:

· rm
· cp
· mv
· if
· test
· alias
· getopts and shift (See by man bash)
· how the path works

Safe rm command

Write a safe rm command to replace the UNIX rm command i.e. it should work exactly the same, error messages etc. The new command should move the deleted files/directories to a directory called $HOME/deleted. If the file is already in $HOME/deleted it should be replaced by the current version. Also you should make it possible so the user can restore the file/directory in its previous directory.

PLEASE HELP ME!!!!

Regards,

pksb
# 2  
Old 11-07-2005
Please read the rules:

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

(6) Do not post classroom or homework problems.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Creating a .profile, displaying system variables, and creating an alias

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: Here is what I am supposed to do, word for word from my assignment page: 1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies

2. Solaris

Application runs well on 4m but not on 4u...

Hi All, Exactly same OS (2.5.1) same pacthes but an application works well on 4m machine (Sparc20) but not on 4u machine (Ultra 1). Processor families are different Ultra's more recent one, I know that. Maybe some cpu specific compiler directives were used while compiling the application. Any... (0 Replies)
Discussion started by: endoavour
0 Replies

3. Shell Programming and Scripting

Creating a Shortcut (to just type "l" but it runs "ls -lah")

How do I create shortcuts? For example: I just want to type one key "l" and have it output the command of "ls -lah" I believe it's creating a file called l with 755 permissions but I'm not sure where to put the file. *if it matters, I'm on a shared hosting web server using cPanel with... (2 Replies)
Discussion started by: ijustsawmars
2 Replies

4. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

5. Shell Programming and Scripting

command runs, no output

I have a script that searches for specific information from log files. #!/bin/sh sed -n '/*C/,/END/p' /sn/log/OMlog* > crit.out sed -n '/REPT INITIALIZATION/,/err:/p' /sn/log/OMlog* > switchcc.out ./start.awk /sn/log/OMlog* > ARs.out ./end.awk /sn/log/OMlog* > ARe.out cat crit.out... (1 Reply)
Discussion started by: grinds
1 Replies

6. UNIX for Advanced & Expert Users

Minutes a program runs.

I have a ksh script that executes a program with a predetermined timeout in minutes. If the program takes longer then the timeout then it still completes with a return code of 0. :confused: I would like to determine how long the program ran. Then if it takes longer than the timeout I would... (7 Replies)
Discussion started by: 2dumb
7 Replies

7. Shell Programming and Scripting

Creating a saferm that runs like rm

Hi, I have a problem with the following. I am trying to learn UNIX and as I am not an expert I don't know how to do the following exercise: Requirement: Show knowledge of how to use some or all of the following commands: · rm · cp · mv · if · test · alias · getopts and shift (See by... (0 Replies)
Discussion started by: pksb
0 Replies

8. UNIX for Advanced & Expert Users

My script runs too slow :-(...

Hello experts, I have a series issue in script that result with bad peformence and I wonder if you can assist me. For example I have two files: File-New, size 15Mb. File-Old, size 1Mb. File-New content: a b c k File-Old content: d f a b (0 Replies)
Discussion started by: roybe
0 Replies

9. UNIX for Dummies Questions & Answers

What user runs cron?

I have a command that is found in /usr/ud51/bin called stopudt which safely stops idle database users (let's writes finish, etc). If I login as root and issue stopudt the process is stopped. I put a script in cron to run it and it says stopudt not found. /usr/ud51/bin is in root's PATH. ... (10 Replies)
Discussion started by: michieka
10 Replies
Login or Register to Ask a Question