[Gllug] Removing special characters from filenames with bash

Dylan dylan at dylan.me.uk
Sun Mar 12 01:02:46 UTC 2006


Hi

I'm trying to sort out a script which will recurse a directory structure 
and rename any file or directory as follows:

A) upper case changed to lower case;
B) special characters removed (excepting last . );
C) spaces replaced with underscores.

I can do B and C with $(x//y/z) but can't see a way to do A without 
writing 26 statements. Is there a way to combine:

for x in {A..Z}

and

for x in "A a" "B b" ...

for example?

Cheers
Dylan
-- 
"The man who strikes first admits that his ideas have given out."
                                                (Chinese Proverb)
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list