--On Wednesday, February 28, 2007 17:16:35 -0600 Josh Tolbert <[EMAIL PROTECTED]> wrote:

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?

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

Thanks, Josh.  That worked exactly as I wanted.

Paul Schmehl ([EMAIL PROTECTED])
Senior Information Security Analyst
The University of Texas at Dallas

Reply via email to