Xref: utzoo comp.unix.questions:15906 comp.lang.c:21131 Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions,comp.lang.c Subject: Re: moving upper case names to lower case -- Followups to comp.unix.questions Message-ID: <2383@auspex.auspex.com> Date: 24 Aug 89 18:18:39 GMT References: <20672@adm.BRL.MIL> <9326@chinet.chi.il.us> <2336@oakhill.UUCP> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 33 >>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... "tolower()" was changed from a macro that doesn't check whether its argument is upper-case to a function that checks whether its argument is upper-case somewhere around System III or System V. Systems still using the older AT&T version of "tolower()" - which pretty much means BSD-flavored systems - still have a "tolower()" that's an "unsafe" macro. Most such systems have both BSD and System V environments; in the latter environment, "tolower()" is a safe function and "_tolower()" is the unsafe macro. One exception is BSD itself; it has no System V environment of that sort. However, ANSI C specifies that "tolower()" must be a safe function, which means BSD will probably change at some point (4.4BSD?), and if the other systems continue to offer BSD environments, they will possibly pick up that change (although the adoption of standards such as ANSI C and POSIX will, with any luck, reduce the number of differences between those environments substantially and reduce the need for multiple environments of that sort). >As an answer to the original question (converting files to lowercase), >a simple csh script will do: As long as you have a C shell on your system, which not all people do; it's generally better to do things with Bourne shell scripts, as opposed to C shell or Korn shell scripts, for that reason.