> I didn't know that.  Does linux support global file name changing so 
> that you could replace all instances of "GSC" with "gsc?" and all 
> instances of "N" and "S" with "n" and "s"? all this spanning 
> multiple directories? I would hate to think of changing each of the 
> 9537 file names by hand!
> Dick

It could certainly be done with a combination of 'find', 'tr', 'mv' 
and a regex search, but without a *nix box handy here at home to test 
it on, I'm hesitant to give you an off-the-cuff command line that 
might be subtly wrong and end up eating half of your system... :-)

But, yes, it certainly can be done.

To get you started, read up on 'find', 'mv', 'tr', possibly 'xargs' 
and the construction of a "while.." loop. What you want to do is to 
search for the files to be renamed, using as tight a match pattern as 
you can (using 'find'). Pass each one it find to 'mv' to rename it, 
using 'tr' to substitute lowercase letter for upper.

Sorry to be of so little help, but I'm currently running only XP here 
at home and it hardly has the command line power of *nix. One way of 
doing it could be *something* like :

find -name <regex pattern here> |
while read each
do
        mv $each `echo $each | tr '[A-Z]' '[a-z]'`
done

That will change ALL uppercase letters to lowercase, so if that's not 
what you want, don't use it. I offer this only as food for thought, 
not a usable example. :-)

Other ways to do it include 'find'ing all the files and writing their 
names to a file. In an editor, manually search and replace the text 
as you need, then save it to another file. There are then ways to use 
those two files in a script or command line loop to rename the 
files... ahh, the power of unix! There's always another way to 
confuse yourself! :-) All this sounds like a lot of work to rename 
some files, but over the long run, learning the unix command line 
really pays dividends in the most unexpected places.

-- 
 Len Philpot                          ><> 
 [EMAIL PROTECTED]       http://philpot.org/





------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EA3HyD/3MnJAA/79vVAA/1.XolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/skychart-discussion/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to