*BSD News Article 83187


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!EU.net!sun4nl!surfnet.nl!swidir.switch.ch!scsing.switch.ch!elna.ethz.ch!usenet
From: Per Kistler <kistler@micro.biol.ethz.ch>
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: Tue, 19 Nov 1996 10:32:30 +0000
Organization: ETH, Swiss Federal Institue of Technology
Lines: 44
Message-ID: <32918CBE.2781@micro.biol.ethz.ch>
References: <01bbd5d3$54b9d060$86629dcc@big-one>
NNTP-Posting-Host: dingo.ethz.ch
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0Gold (X11; I; IRIX 6.2 IP22)
To: Erotic Delirium <kelly@eroticd.com>
Xref: euryale.cc.adfa.oz.au comp.infosystems.www.servers.unix:22085 comp.unix.bsd.freebsd.misc:31239 comp.unix.programmer:46529 comp.unix.questions:91523

Hi

#!/usr/bin/ksh

# Change files and dirnames even in sudirs:
# usage: thisprog u|l

find . -depth -print | {

   while read file; do

      if [[ ${file##*/} = ${0##*/} ]];then
         continue
      fi

      if [[ -d $file || -f $file ]];then

         filealt=$file
         case $1 in

         u|U|g|G) fileneu="${file%/*}/$(print ${file##*/}|tr '[a-z]'
'[A-Z]' )"
                  mv $filealt $fileneu;;

         l|L|k|K) fileneu="${file%/*}/$(print ${file##*/}|tr '[A-Z]'
'[a-z]')"
                  mv $filealt $fileneu;;

         *)       print "\nusage: ${0##*/} u|l\n"
                  exit 1

         esac
      fi
   done
}

If I missunderstood your question, please mail me:-))

Bye, Per.
-- 
Per Kistler, Zuerich, Switzerland. (I love unix/ksh/awk/perl/C++)
kistler@micro.biol.ethz.ch
http://www.micro.biol.ethz.ch/~pkistler
----------------------------------------------------------------------