From owner-freebsd-hackers Mon Oct 1 5:29:46 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bugz.infotecs.ru (bugz.infotecs.ru [195.210.139.22]) by hub.freebsd.org (Postfix) with ESMTP id EED2737B407 for ; Mon, 1 Oct 2001 05:29:40 -0700 (PDT) Received: (from root@localhost) by bugz.infotecs.ru (8.11.6/8.11.4) id f91CRin11441; Mon, 1 Oct 2001 16:27:44 +0400 (MSD) (envelope-from vel) From: "Eugene L. Vorokov" Message-Id: <200110011227.f91CRin11441@bugz.infotecs.ru> Subject: Re: how to make 'for' understand two words as a single argument To: Konstantin.Chuguev@dante.org.uk (Konstantin Chuguev) Date: Mon, 1 Oct 2001 16:27:44 +0400 (MSD) Cc: freebsd-hackers@freebsd.org In-Reply-To: from "Konstantin Chuguev" at Oct 01, 2001 12:55:24 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > "Eugene L. Vorokov" wrote: > > > > > > I have a script which is supposed to convert all filenames to lowercase > > > recursively from current directory. It looks like: > > > > > > echo "Processing files" > > > for i in `ls |grep [A-Z]`; \ > > > do mv $i `echo $i |tr [A-Z] [a-z]`; echo $i;\ > > > done; > > ls |grep [A-Z] | while read i; \ > do mv $i `echo $i |tr [A-Z] [a-z]`; echo $i;\ > done > > > > > > for i in `find . -name "*" -type d -maxdepth 1`;\ > > > do if [ $i != "." ]; then cd $i; echo "Processing sub-dir $i"; $0; cd ..; fi \ > > > done; > > find . -name "*" -type d -maxdepth 1 | while read i; \ > do if [ $i != "." ]; then cd $i; echo "Processing sub-dir $i"; $0; cd ..; fi \ > done This way it works fine, thanks ! Regards, Eugene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message