Path: utzoo!utgpu!watserv1!watmath!att!cbnewsj!davet From: davet@cbnewsj.att.com (Dave Tutelman) Newsgroups: comp.sources.wanted Subject: Re: lowercase routine. Summary: Here's a shell script Message-ID: <1990Sep11.022414.9194@cbnewsj.att.com> Date: 11 Sep 90 02:24:14 GMT References: <745@babcock.cerc.wvu.wvnet.edu> <1990Sep7.204741.21613@uwasa.fi> Organization: AT&T Bell Labs - Lincroft, NJ Lines: 40 In article <745@babcock.cerc.wvu.wvnet.edu> pac@cathedral.cerc.wvu.wvnet.edu (Michael A. Packer) writes: >does anyone have a routine which can be compiled on UNIX that >will read the current directory and convert all upcase names >to lowercase? This isn't "compiled", but I've been using the following shell script for about a year with no problems: -------------------- # Rename file arguments to have all lower-case names, # but don't overwrite existing files. for FILE in $* do NEWNAME=`echo $FILE | grep [A-Z] | tr [A-Z] [a-z]` if [ "a$NEWNAME" != "a" ] then if [ -s $NEWNAME ] then echo "mvlower: $NEWNAME already exists" else echo "mvlower: renaming $FILE to $NEWNAME" mv $FILE $NEWNAME fi fi done ---------------------------- If you store this script as "mvlower", then you can do what you want with mvlower * Cheers! Dave +---------------------------------------------------------------+ | Dave Tutelman | | Physical - AT&T Bell Labs - Lincroft, NJ | | Logical - ...att!pegasus!dmt == dmt@pegasus.att.com | | Audible - (201) 576 2194 | +---------------------------------------------------------------+