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
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

Closed Thread
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
  #1 (permalink)  
Old 12-12-2008
wiggles wiggles is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 7
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
  #2 (permalink)  
Old 12-12-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
please do not duplicate post...:

http://www.unix.com/shell-programmin...ix-script.html
  #3 (permalink)  
Old 12-12-2008
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Pls don't double post - read the forums rules
This sounds like a homework - read the rules.
Thread closed!
Closed Thread

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

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 06:38 PM.


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