From owner-freebsd-questions@FreeBSD.ORG Wed Feb 28 23:16:36 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A980716A40D for ; Wed, 28 Feb 2007 23:16:36 +0000 (UTC) (envelope-from hemi@puresimplicity.net) Received: from just.puresimplicity.net (just.puresimplicity.net [68.77.126.251]) by mx1.freebsd.org (Postfix) with ESMTP id 6567A13C4C1 for ; Wed, 28 Feb 2007 23:16:36 +0000 (UTC) (envelope-from hemi@puresimplicity.net) Received: from just.puresimplicity.net (localhost.puresimplicity.net [127.0.0.1]) by just.puresimplicity.net (8.13.8/8.13.6) with ESMTP id l1SNGZG8074376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Feb 2007 17:16:35 -0600 (CST) (envelope-from hemi@just.puresimplicity.net) Received: (from hemi@localhost) by just.puresimplicity.net (8.13.8/8.13.6/Submit) id l1SNGZor074375; Wed, 28 Feb 2007 17:16:35 -0600 (CST) (envelope-from hemi) Date: Wed, 28 Feb 2007 17:16:35 -0600 From: Josh Tolbert To: Paul Schmehl Message-ID: <20070228231635.GB73748@just.puresimplicity.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Greylist: Sender is SPF-compliant, not delayed by milter-greylist-2.0.2 (just.puresimplicity.net [127.0.0.1]); Wed, 28 Feb 2007 17:16:35 -0600 (CST) Cc: FreeBSD Questions Subject: Re: find returns unusable result X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2007 23:16:36 -0000 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