![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Need help in writing script for finding files in the unix machine? | rparsa001 | Shell Programming and Scripting | 3 | 01-22-2009 11:45 AM |
| need help writing this unix script | wiggles | Shell Programming and Scripting | 7 | 12-12-2008 09:15 PM |
| Perl Unix Script Writing | Dinkster | UNIX for Dummies Questions & Answers | 1 | 02-01-2008 04:09 PM |
| Writing and executing a script in RTR implementation of UNIX | mahajan.anubhav | Shell Programming and Scripting | 0 | 03-16-2006 05:20 AM |
| Need help in writing a unix script | pray44u | Shell Programming and Scripting | 1 | 03-30-2005 08:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
help writing this unix script
I am working on writing scripts. Here is a script I need help with. I have also wrote what I think it is. I would really appreciate any help that I can get.
Create an executable script file called "newname" that will perform the followings: 1. Rename a file upon the user’s request. If the file exists, prompt the user for confirmation before renaming the file. The screen should prompt the user for a. "Name of file you want to rename." Use the "\c" escape character. b. "New name of file" Use the "\c" escape character. c. "File Exist" to avoid overriding a file. d. "File $oldname changed to $newname" e. "Do you want to rename another file?" If the user selects "yes" the system should refresh the screen and if the user selects "no" the system should exit to the prompt sign. f. Refresh the screen to go back to the menu until the user selects the exit option This is what I wrote rm -i Read a file to rename If file do not exist Then Rename the file If file do exist Then Ask "Do you want to ovveride file?" Read the user's choice (y/n) If the answer is yes (y) Rename the file If the answer is no (n) Display "File Exist" Refresh the screen (b)Exit |
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|