The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How the first script should notify in case there is no response from second rajusa10 Shell Programming and Scripting 4 03-19-2008 01:35 PM
Script needed to select and delete lower case and mixed case records abhilash mn Shell Programming and Scripting 1 03-17-2008 08:00 AM
Clear Case, Awk and script mastachef Shell Programming and Scripting 0 10-30-2007 01:11 PM
Swutch-Case script rawatds Shell Programming and Scripting 1 12-02-2004 07:43 AM
lower case to upper case string conversion in shell script dchalavadi UNIX for Dummies Questions & Answers 3 05-29-2002 01:07 AM

 
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 04-23-2008
jazz8146 jazz8146 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 20
case in script

Hello All,
I'll try to get it right this time lol

I am trying to do some validation on my script which renames files.
The ones i am struggling with are:


e.g.

1. myscript myfile myfile2 (so my script changes myfile to myfile2 if myfile exists)
output : myfile does not exist

2. myscript myfile myfile2 blurb
cannot have anything after rename

3. myscript myfile
must have name to rename2

Hope that makes sense. I'll put a bit of my code in to try to make it clearer

case $# in
0) echo "nothing has been entered"
exit
;;
1) echo "file none existent"
exit
;;
2) echo "dosRename: $file: Can't have anything after target"
exit
;;
3) echo "no new name"
exit
;;
*)
 

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 04:57 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