Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.sgi.com!news.mathworks.com!howland.erols.net!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!dispatch.news.demon.net!demon!awfulhak.demon.co.uk!awfulhak.demon.co.uk!awfulhak.demon.co.uk!not-for-mail From: brian@anorak.utell.net (Brian Somers) Newsgroups: comp.infosystems.www.servers.unix,comp.unix.bsd.freebsd.misc,comp.unix.programmer,comp.unix.questions Subject: Re: Help Need a UTIL for Case Sensitive Files. Date: 21 Nov 1996 16:39:52 -0000 Organization: Coverform Ltd. Lines: 39 Sender: brian@awfulhak.demon.co.uk Message-ID: <5720ko$3v5@anorak.utell.net> References: <01bbd5d3$54b9d060$86629dcc@big-one> <kxrE151Do.Ls2@netcom.com> Reply-To: brian%anorak.coverform.lan@awfulhak.demon.co.uk NNTP-Posting-Host: anorak.coverform.lan X-NNTP-Posting-Host: awfulhak.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Newsreader: knews 0.9.8 Xref: euryale.cc.adfa.oz.au comp.infosystems.www.servers.unix:22251 comp.unix.bsd.freebsd.misc:31436 comp.unix.programmer:46757 comp.unix.questions:91804 In article <kxrE151Do.Ls2@netcom.com>, kxr@netcom.com (Keith Rich) writes: : In article <01bbd5d3$54b9d060$86629dcc@big-one> "Erotic Delirium" <kelly@eroticd.com> writes: : : Make a shell script called upp2low containing: : : #!/bin/sh : dirname=`dirname $1` : basename=`basename $1` : basenew=`echo $basename | tr A-Z a-z` : if test "$basenew" != "$basename"; then : (cd $dirname ; mv $basename $basenew) : fi : : Then invoke it as follows: : : find dir -depth -exec upp2low {} \; : : The -depth will make sure that all sub-directories get renamed before : the upper level directories. The dirname/basename stuff is changing : only the lowest level name; without that it won't work right. : : For a System V Unix (rather than BSD), change "tr A-Z a-z" to: : : tr '[A-Z]' '[a-z]' Hmmm, someone that knows what they're talking about ! I missed the dirname basename bit ! Of course, it should be remembered that doing the whole thing inline will speed the process - if you make the above "script" into a shell function and replace basename & dirname with ${var##*/} and ${var%/*} constructs, it should do the job quicker. -- Brian <brian%anorak.coverform.lan@awfulhak.demon.co.uk> <http://www.awfulhak.demon.co.uk/> Don't _EVER_ lose your sense of humour.... .