Xref: utzoo comp.unix.questions:15868 comp.lang.c:21101 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!image.soe.clarkson.edu!news From: cline@sun.soe.clarkson.edu (Marshall Cline) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: moving upper case names to lower case -- Followups to comp.unix.questions Message-ID: Date: 23 Aug 89 19:22:10 GMT References: <20672@adm.BRL.MIL> <9326@chinet.chi.il.us> <2336@oakhill.UUCP> Sender: news@sun.soe.clarkson.edu Reply-To: cline@sun.soe.clarkson.edu (Marshall Cline) Organization: Clarkson University, Postdam NY Lines: 36 In-reply-to: stevenw@oakhill.UUCP's message of 23 Aug 89 14:07:08 GMT >>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 >>>I could always right a C program, but there gotta be a better way. >In article <9326@chinet.chi.il.us>, john@chinet.chi.il.us (John Mundt) writes: >>#include >>#include >>main() >>{ register int c; >> while ((c = getchar()) != EOF) putchar(tolower(c)); >>} In article <2336@oakhill.UUCP> stevenw@oakhill.UUCP (Steven Weintraub) writes: >I should point out there is a risk in using tolower like this. Some >machines define tolower as ((c)-'A'+'a') (like some sun systems). ^^^ The Gould UTX systems also do this ------------------ Ie: tolower() does exactly what TurboC calls _tolower() -- it _assumes_ its arg is an upper case letter... As an answer to the original question (converting files to lowercase), a simple csh script will do: #! /bin/csh -f foreach file ($*) mv $file `echo $file | tr A-Z a-z` end Marshall -- __________________________________________________________________ Marshall P. Cline Internet: cline@sun.soe.clarkson.edu ECE Department Usenet: uunet!sun.soe.clarkson.edu!cline Clarkson University Bitnet: BH0W@CLUTX Potsdam, NY 13676 AT&T: 315-268-6591