From owner-freebsd-questions Tue Jun 4 22:11:22 2002 Delivered-To: freebsd-questions@freebsd.org Received: from lexx.zssm.zp.ua (lexx.zssm.zp.ua [212.8.32.8]) by hub.freebsd.org (Postfix) with ESMTP id EC98137B400 for ; Tue, 4 Jun 2002 22:11:09 -0700 (PDT) Received: from server.hermes-comp.zp.ua (germes-comp.zssm.zp.ua [212.8.32.132] (may be forged)) by lexx.zssm.zp.ua (8.9.2/8.9.2) with ESMTP id IAA07784; Wed, 5 Jun 2002 08:07:46 +0300 (EET DST) Received: from localhost (localhost [127.0.0.1]) by server.hermes-comp.zp.ua (8.11.3/8.11.3) with ESMTP id g5553dq38243; Wed, 5 Jun 2002 08:04:16 +0300 (EEST) (envelope-from stalker@hermes-comp.zp.ua) Date: Wed, 5 Jun 2002 08:03:39 +0300 (EEST) From: Alexander V Zubchenko To: "Morse, Richard E." Cc: "'Ryan Thompson'" , Steven Lake , Subject: RE: Questions about Chmod In-Reply-To: <375F68784081D511908A00508BE3BB1701EF1B2F@phsexch22.mgh.harvard.edu> Message-ID: <20020605080125.V38194-100000@server.hermes-comp.zp.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Greetings, All! On Tue, 4 Jun 2002, Morse, Richard E. wrote: > Ryan Thompson [mailto:ryan@sasknow.com] wrote: > > > find(1) will assist you with this. find(1) allows you to apply > > commands to each file it matches. So, something like > > > > chmod 755 `find . -name "WWW" -print` > > > > Should do the trick. > > This will possbily have a problem: find will output a newline separated > list. This could confuse the chmod command.... > > instead: read the find manpage, as well as the xargs manpage. You should be > able to type something _like_ (I'm not positive it's exactly this, but it > approaches) > > find . -name "WWW" -exec "chmod 755 {}" -print > > or: > > find . -name "WWW" -print | xargs chmod 755 And i want to add two other examples: chmod 755 `find . -name "WWW" -print` or: foreach i (``); chmod 755 $i; end > > People differ on which version they prefer, and in some situations they like > one or the other (I think it depends on if they feel like piping through a > tee or not...) > > HTH, > Ricky > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > Alexander To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message