Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!cbmvax!ag From: ag@cbmvax.UUCP (Keith Gabryelski) Newsgroups: comp.unix.questions Subject: Re: moving upper case names to lower case Message-ID: <7736@cbmvax.UUCP> Date: 23 Aug 89 17:02:23 GMT References: <20672@adm.BRL.MIL> <9326@chinet.chi.il.us> Reply-To: ag@cbmvax.UUCP (Keith Gabryelski) Organization: Commodore Technology, West Chester, PA Lines: 48 In article <9326@chinet.chi.il.us> john@chinet.chi.il.us (John Mundt) writes: >In article <20672@adm.BRL.MIL> Leisner.Henr@xerox.com (Marty) writes: >>I'm looking for a good, clean way to move files from upper case names to >>lower case names. >> >>i.e. FOO.C to foo.c > >#include >#include > >main() >{ > register int c; > while ((c = getchar()) != EOF) > putchar(tolower(c)); >} > >It's easier to write and compile this than to get tr to massage >the string for you. Observe. (the bourne shell) $ for i in * ; do mv $i `echo $i | tr '[A-Z]' '[a-z]'` ; done Or: $ find . -type f -print | > while read filename > do > mv $filename `echo $filename | tr '[A-Z]' '[a-z]'` > done Your code didn't solve any complex problem. The only thing removed from the above two commands is: tr '[A-Z]' '[a-z]' and it would be replaced the name of the program you gave above (possibly called 'mybrokentrwhichdoesnottakearguemnts' or maybe 'tolower'). On top of it all your solution would take compile time. Pax, Keith -- "It took no computation to dance to the rock 'n roll station" -- Lou Reed ag@cbmvax.commodore.com Keith M. Gabryelski ...!uunet!cbmvax!ag