[CentOS] Re: manipulating files and directories with spaces

Thu Nov 22 13:40:03 UTC 2007
William L. Maltby <CentOS4Bill at triad.rr.com>

On Wed, 2007-11-21 at 10:46 +0000, Tony Mountifield wrote:
> In article <1195638046.5747.31.camel at centos01.homegroannetworking>,
> William L. Maltby <CentOS4Bill at triad.rr.com> wrote:
> > On Wed, 2007-11-21 at 10:04 +0100, Ralph Angenendt wrote:
> > > Shad L. Lords wrote:
> > > > find . -type type -print0 | xargs -0 chmod value
> > > 
> > > Or (SUSV compliant): 
> > > 
> > > find . -type f -exec chmod 123 {} +
> > 
> > P.S.
> > 
> >  Don't forget to escape the "{" and "}".

> 
> Why? I've never needed to.

Well, for a *long* time, the shell would react to them. Does it still? I
don't know. But on this machine

$ lsb_release -a
LSB Version:    :core-3.0-ia32:core-3.0-noarch:graphics-3.0-
ia32:graphics-3.0-noarch
Distributor ID: CentOS
Description:    CentOS release 4.5 (Final)
Release:        4.5
Codename:       Final

$ rpm -q findutils
findutils-4.1.20-7.el4.3.i386

<partial quote from "man find>
... All following arguments to find are taken to be arguments to the
command until an argument consisting of ';' is encountered. ... Both of
these  constructions might need to be escaped (with a      '\') or
quoted to protect them from expansion by the 
</partial quote from "man find>

Since I'm an old user with old habits (which, as we know, die hard), I
still put them in, along with the '\;' at the end. If I get really
energetic (or maybe it's lazy?) I might invest the time and energy to
experiment and see what works here. Of course, then I'm setting myself
up to forget whether I'm on CentOS 4 or 5 (I don't use my 5 much yet) or
LFS or ... :-(

I think I'll stick with what works more "universally".

> 
> Cheers
> Tony

--
Bill