The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: rename
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-07-2008
bohoo bohoo is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 1
rename

hi,

im doin an assignment which requires you to build a shell script to do the MS DOS style equivilant (sp?) of the rename function. What i have to do is a loop which checks the following rules and output messages (same):

Can't have anything after target
Can't have more than one dot
Can't have more than one asterisk
Doesn't exist
Must have a dot
No target

Targets consist of three parts: a dot, an asterisk and a string of filename characters. The dot is the middle one of the three. I have not started anything of yet as im stick on this first part and have little idea on how to do it. I an wondering if someone could give me a idea on how i would approach this. I have been told that a loop would be best.

Thanks