Thus spake Mark <[EMAIL PROTECTED]>: > ----- Original Message ----- > From: "Ceri Davies" <[EMAIL PROTECTED]> > To: "Mark" <[EMAIL PROTECTED]> > Cc: "Andrew Cutler" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Friday, December 20, 2002 3:15 PM > Subject: Re: chown broken?? > > > > On Fri, Dec 20, 2002 at 03:12:17PM +0100, Mark wrote: > > > > > I must say, though, that while I understand this behaviour, one can > > > argue on what exactly "recursive" is to mean here. Intuitively, > > > the definition of "the current sub-directory and all sub-directories > > > below the current directory (and that for each subdirectory)" seems > > > the correct one. Which would exclude "..", as this is not a > sub-directory > > > of the current directory, but the parent. > > > > Not really. It recurses through the directories named on the command > > line, of which '..' happens to be one. > > > Yes, "the directories named on the command line" within the CURRENT > directory. Technically, "." and ".." are entries within the current > directory (try: "od -c ."), and they have inode numbers too. But that does > not deter me from deeming it a bit counter-intuitive to consider ".." a > directory of the current directory. :) Especially in the context of > recursion.
So you want 'chown foo ..' to fail, as a special case? As I mentioned before, rm gets away with this because you don't want to remove the parent of the directory you're currently in. (Actually, some rm implementations *will* let you shoot yourself in the foot.) But it's perfectly reasonable to chown '..', even recursively, so chown can't make any assumptions. I object to going around and documenting this caveat in the manpages for every single utility that supports recursion through a directory tree. It doesn't really belong there, it belongs in a ``How to use the shell'' tutorial. The way Unix traditionally does parameter expansion makes it easy to shoot yourself in the foot in at least a dozen ways, and this is just one of them. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message