From owner-freebsd-questions Fri Dec 20 5:51:25 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AEF2B37B401 for ; Fri, 20 Dec 2002 05:51:24 -0800 (PST) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1508143EDA for ; Fri, 20 Dec 2002 05:51:24 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id gBKDpFDZ039783; Fri, 20 Dec 2002 05:51:15 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id gBKDpFot039782; Fri, 20 Dec 2002 05:51:15 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Fri, 20 Dec 2002 05:51:15 -0800 From: David Schultz To: Andrew Cutler Cc: setantae@submonkey.net, freebsd-questions@FreeBSD.ORG Subject: Re: chown broken?? Message-ID: <20021220135115.GA38907@HAL9000.homeunix.com> Mail-Followup-To: Andrew Cutler , setantae@submonkey.net, freebsd-questions@FreeBSD.ORG References: <1040390551.921.36.camel@localhost> <20021220132634.GA6498@submonkey.net> <1040391396.921.43.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1040391396.921.43.camel@localhost> 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 Thus spake Andrew Cutler : > I realise that now, but why does chown not ignore the match since most > other commands simply return? > . is a directory -- ignored > .. is a directory -- ignored > > This inconsistency is not logical. rm makes a special case for '.' and '..' specifically to avoid this kind of foot-shooting. It gets away with it because it doesn't make much sense to remove your current directory, much less its parent. Unfortunately, you can't really do the same thing for chown because people sometimes do say 'chown -R foo .' and really mean it. Since the '.*' is expanded by the shell, chown has no way of knowing what was really meant. (BTW, the example I gave shows you how to do what you were trying to do, without the problems you ran into.) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message