This is the mail archive of the
mailing list for the Cygwin project.
Re: Path confusion
- From: Luke Kendall <luke dot kendall at cisra dot canon dot com dot au>
- To: cygwin at cygwin dot com
- Date: Fri, 1 Apr 2005 17:02:21 +1000 (EST)
- Subject: Re: Path confusion
On 1 Apr, Igor Pechtchanski wrote:
> > Luke Kendall wrote:
> > > find `cygpath -m /` -xdev -user $USER -print \
> > > | tr "\n" "\000" \
> > > | xargs -0 chown Administrators.SYSTEM
> > You can use -print0, and since find is a cygwin application I don't see
> > what the point of using cygpath is:
I think you're right. I was trying to limit it via the directory root
at first, not realising c:/cygwin would be re-written as "/" anyway.
So you're right, the -xdev is sufficient.
The reason for the tr instead of the -print0 was so that other shell
filters (like grep) could be interposed there if needed. Which
certainly wasn't obvious, I confess. Without them, -print0 yields a
clearer and faster solution.
> > find / -xdev -user $USER -print0 | xargs -0 chown Administrators.SYSTEM
> Both of us have neglected the same pitfall:
> find / -xdev -user "$USER" -print0 | xargs -0 chown Administrators.SYSTEM
Ah, the new spaces in user names feature. Good point!
> > Though I would be tempted just to do "chown -R / ..."
> You must mean 'chown -R --from="$USER" ...' :-)
Hmm, sounds better still. :-)
> > or even better, just set the desired ACL on c:\cygwin before installing
> > and let it be inherited.
> That doesn't change the owner, though. One may want to allow only users
> with administrative privileges to modify system programs, in which case a
> chown does make sense.
This makes me recall another oddity, but I should probably start a
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html