Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2007 17:16:35 -0600
From:      Josh Tolbert <hemi@puresimplicity.net>
To:        Paul Schmehl <pauls@utdallas.edu>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: find returns unusable result
Message-ID:  <20070228231635.GB73748@just.puresimplicity.net>
In-Reply-To: <D29D90080F802A4D1BBB3EDE@utd59514.utdallas.edu>
References:  <D29D90080F802A4D1BBB3EDE@utd59514.utdallas.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 28, 2007 at 05:12:58PM -0600, Paul Schmehl wrote:
> I'd like to cron a process that looks at a certain folder every day and 
> changes the perms on a directory if they aren't what I want. 
> Unfortunately, the people creating the folders are Windows folks using 
> WinSCP, and so they create folders with spaces in them.  (E.g. Day 1, Day 
> 2, etc.)
> 
> I thought I could just do this:
> chmod 755 `find /path/to/dirs -type d`
> 
> but find returns a directory name of Day, Day, Day, which (obviously) 
> doesn't work.
> 
> >From the cli, find returns the actual directory name.
> 
> How can I get find to return the dirs correctly in a script?  Or is there 
> some other way to do this that would work?
> 
> Paul Schmehl (pauls@utdallas.edu)

find /path/to/dirs -type d -print0 | xargs -0 chmod 755

Thanks,

Josh
-- 
Josh Tolbert
hemi@puresimplicity.net  ||  http://www.puresimplicity.net/~hemi/

Security is mostly a superstition. It does not exist in nature, nor
do the children of men as a whole experience it. Avoiding danger
is no safer in the long run than outright exposure. Life is either
a daring adventure, or nothing.
    -- Helen Keller



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