coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: chmod: man page clarification for letter X


From: Kaz Kylheku (Coreutils)
Subject: Re: chmod: man page clarification for letter X
Date: Thu, 08 Oct 2020 11:27:04 -0700
User-agent: Roundcube Webmail/0.9.2

On 2020-10-08 10:28, Tomás Fernandes wrote:
Hello,

I've recently come across chmod's man page as someone who is not very
experienced (1st year CS undergrad), and found that the definition of the
letter X in the man page a bit unclear, more specifically this part (in
bold):

On the topic of chmod documentation, it could use a clarification in the
following matter.

chmod supports a = operator for copying permissions. For instance
u=g means "make the u permissions be like g".

chmod also supports multiple operations, like

  u=g,g=o

The behavior of GNU Coreutils chmod is that the = operator samples the
most *new* value of the permissions (everything to the left has already
taken place). This is true even without the comma separation, when =
is combined in one clause with other operators, as in:

  o+x=o

Here, the o+x will apply the x permission to o. Then this effect is settled
and the =o assignment therefore has no effect; it's the same as:

  o+x,o=o

Or something like that; I've not looked at this stuff in a while,
but it was one of the issues I ran into when making a chmod implementation.

It would be good if the documentation spelled it out that = references
the new permissions which result from everything to the left of =
having been processed.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]