[Techtalk] lower to upper case

Miriam English mim at miriam-english.org
Tue Oct 9 22:58:43 UTC 2007


Thanks for the great ideas folks. I'm rapt!

> On 10/9/07, Miriam English <mim at miriam-english.org> wrote:
>> for file in *
>> do
>>         mv $file `echo $file | tr '[a-z]' 'A-Z'`
>> done
>>...
>> Is there an even simpler way?


Wim De Smet wrote:
> I don't think it is simpler, but you could do the same thing with sed
> instead of tr. I think that would be : sed 's/.*/\U&/'

Ahhhh yes, I *thought* there must be some way to use that kind of magic. 
Thanks Wim.


Kathryn Hogg wrote:
 > Not necessarily simpler but you should use tr '[:upper:]' '[:lower:]'

I'd wondered about that, but I'd got my syntax wrong. Thanks Kathryn. 
Those kinds of character class operators make a lot of other things 
possible too that are otherwise extremely difficult, like [:punct:] for 
instance.


Marize Pommot-Maia wrote:
 > How about just using 'rename'?  As in:
 >   rename .JPG .jpg *.JPG

Gosh. I've never noticed rename before. Thanks Marize. I'll look into 
that more.


Benjamin A'Lee wrote:
 > Take a look at moreutils (http://kitenet.net/~joey/code/moreutils, or 
available
 > as a debian package). It includes a script 'vidir' which lets you edit a
 > directory in your text editor, so you can do anything that you can do 
with vi.

This is great stuff. Thanks Ben. I've always loved the idea of trying to 
see the things around us that are rendered invisible by us taking them 
for granted. That is what this guy Joey appears to have done -- looked 
for the empty areas that most of us never notice. How cool!

Best wishes,

	- Miriam

-- 
---------=---------=---------=---------=---------=---------=------
A life! Cool! Where can I download one of those from?
---------=---------=---------=---------=---------=---------=------
Website: http://miriam-english.org
Blog: http://www.livejournal.com/users/miriam_e/


More information about the Techtalk mailing list