From owner-freebsd-questions Sat Jan 2 15:02:03 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA11861 for freebsd-questions-outgoing; Sat, 2 Jan 1999 15:02:03 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from fir.calcasieu.com (fir.calcasieu.com [209.99.46.67]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA11831 for ; Sat, 2 Jan 1999 15:01:59 -0800 (PST) (envelope-from sysop@austin.calcasieu.com) Received: from oak.austin.calcasieu.com (oak.austin.calcasieu.com [192.168.170.7]) by fir.calcasieu.com (8.8.8/8.8.8-2.0) with SMTP id RAA27824; Sat, 2 Jan 1999 17:01:34 -0600 (CST) Received: by oak.austin.calcasieu.com id AA21324 for freebsd-questions@freebsd.org; Sat, 2 Jan 1999 17:01:31 -0600 From: Don Read Message-Id: <9901022301.AA21324@oak.austin.calcasieu.com> Subject: Re: lowercase filenames To: gjb@acm.org (Greg Black) Date: Sat, 2 Jan 1999 17:01:31 -0600 (CST) Cc: , freebsd-questions@FreeBSD.ORG In-Reply-To: <19990101145824.16515.qmail@alice.gba.oz.au> from "Greg Black" at Jan 2, 99 00:58:23 am X-Mailer: ELM [version 2.4 PL25] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > What if $old.tmp exists? > > What if $new.bak exists? > All too true, a first whack at the script; proto-code = proto-think. > > > #!/bin/sh > for old in *[A-Z]* ; do > new=$(echo $old | tr A-Z a-z) > [ -e $new ] && echo - $new already exists || ( set -x ; mv $old $new ) > done > not portable #!/bin/sh for old in *[A-Z]* do new=`echo "$old" | tr "[A-Z]" "[a-z]"` mv -i $old $new done # 'course in rev .3 might wish to check for directories & specials ... ;> Regards, -- Don Read sysop@calcasieu.com EDP Manager dread@texas.net Calcasieu Lumber Co. Austin TX -- Will sysadmin for food To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message