Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Oct 2001 16:27:44 +0400 (MSD)
From:      "Eugene L. Vorokov" <vel@bugz.infotecs.ru>
To:        Konstantin.Chuguev@dante.org.uk (Konstantin Chuguev)
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: how to make 'for' understand two words as a single argument
Message-ID:  <200110011227.f91CRin11441@bugz.infotecs.ru>
In-Reply-To: <no.id> from "Konstantin Chuguev" at Oct 01, 2001 12:55:24 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> > "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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110011227.f91CRin11441>