Re: OFFTOPIC: Re: hardlinks.... sucks... ;-(

ralf@uni-koblenz.de
Mon, 12 Jan 1998 11:56:31 +0100


On Thu, Jan 08, 1998 at 09:01:25PM +0000, Jamie Lokier wrote:

> On Wed, Jan 07, 1998, Andreas Kostyrka wrote:
> > One can use also:
> > find / -user 1234 -print0 | xargs -0 chown 4321
> > (That should solve the problem with spaces, etc.)
>
> But not the problem with files staring with `-'. This instead, maybe:
>
> find / -user 1234 -print0 | xargs -0r chown 4321 --
>
> It still has the race condition, of course. If I really had to do this,
> I'd use find piped into a Perl script using readdir/open/fstat/fchown.
> Even this can be made to chown files outside the user's directory (but
> still owned by the user) though.

You still have trouble with the filename ``_'' which is magic for GNU
xargs, so add the option -e. Actually that eof string feature is
pretty annoying, imho it should be off by default.

Ralf