Philip S Tellis wrote:
> 
> but you want to rename
> s*.abc to s*.sNN 
> 
> so, try this: 
> 
> n=0; for i in *.abc do n=$(($n+1)); mv $i ${i%abc}${${i%${i#?}}$n; done 
> 

 Sorry Philip, your script gave "syntax error near token 'mv' " error 
message.
 What's problem ? 

> this is not perfect - you'll get extensions like .s1 - .s9, then .s10 -
> .s99 and then .s100 -> 
> 

 Hmm... It will be disastrous. These files will be shared in DOS, so should 
follow the rule - 8.3 filename format.
 Also I do'nt know what will happen, if there are more than 100/200 files in 
a directory. May-be something like sand.s99.. , sando.01s.., sandon.99s..., 
and lastly sandox.0s1..., sandoz.9s9. And after that a new directory .
 They are maintaining separate file for each customer of their all-india 
clients. I have already seen some 160 files of the same alphabet in a 
directory. 

Thanks ! 

~ Pat 


> so, if you want better extensions, put the n=$(($n+1)) inside a
> condition to decide what it should be. 
> 
> --


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to