From owner-freebsd-questions@FreeBSD.ORG Wed Feb 28 23:57:06 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 C8F7D16A400 for ; Wed, 28 Feb 2007 23:57:06 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp2.utdallas.edu (smtp2.utdallas.edu [129.110.10.33]) by mx1.freebsd.org (Postfix) with ESMTP id AC35B13C48D for ; Wed, 28 Feb 2007 23:57:06 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd59514.utdallas.edu (utd59514.utdallas.edu [129.110.3.28]) by smtp2.utdallas.edu (Postfix) with ESMTP id 49D175C1CC for ; Wed, 28 Feb 2007 17:57:06 -0600 (CST) Date: Wed, 28 Feb 2007 17:57:06 -0600 From: Paul Schmehl To: FreeBSD Questions Message-ID: <9529489268CFF4F3B1EB1452@utd59514.utdallas.edu> In-Reply-To: <20070228231635.GB73748@just.puresimplicity.net> References: <20070228231635.GB73748@just.puresimplicity.net> X-Mailer: Mulberry/4.0.6 (Linux/x86) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========B68425C5F1AD1808F2E2==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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:57:06 -0000 --==========B68425C5F1AD1808F2E2========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline --On Wednesday, February 28, 2007 17:16:35 -0600 Josh Tolbert=20 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 (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========B68425C5F1AD1808F2E2==========--