From owner-freebsd-questions@FreeBSD.ORG Wed Feb 28 23:33:17 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 3906116A400 for ; Wed, 28 Feb 2007 23:33:17 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from unsane.co.uk (www.unsane.co.uk [85.233.185.162]) by mx1.freebsd.org (Postfix) with ESMTP id AA41213C474 for ; Wed, 28 Feb 2007 23:33:16 +0000 (UTC) (envelope-from jhary@unsane.co.uk) Received: from [192.168.10.217] ([192.168.10.217]) (authenticated bits=0) by unsane.co.uk (8.14.0/8.13.8) with ESMTP id l1SNXBMN002699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Feb 2007 23:33:12 GMT (envelope-from jhary@unsane.co.uk) Message-ID: <45E6113A.2060500@unsane.co.uk> Date: Wed, 28 Feb 2007 23:33:14 +0000 From: Vince User-Agent: Thunderbird 1.5.0.9 (X11/20070129) MIME-Version: 1.0 To: Josh Tolbert References: <20070228231635.GB73748@just.puresimplicity.net> In-Reply-To: <20070228231635.GB73748@just.puresimplicity.net> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Paul Schmehl , 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:33:17 -0000 Josh Tolbert 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? >> >> Paul Schmehl (pauls@utdallas.edu) > > find /path/to/dirs -type d -print0 | xargs -0 chmod 755 > or just find /path/to/dirs -type d -exec chmod 755 {} \; should do it. > Thanks, > > Josh