Operating System - HP-UX
1829887 Members
2459 Online
109993 Solutions
New Discussion

chmod g+x fails but chmod 775 works to activate group execute bit.

 
Weng Seng Tam
New Member

chmod g+x fails but chmod 775 works to activate group execute bit.

Can somebody tell me why the first two chmod commands fail but the third works? It makes absolutely no sense to me. They should achieve the same thing in the given context and yet the results are different.

hp-bugx:/8a/PROJECT >ls -lad 01_IN_PROCESS/test; chmod g+X 01_IN_PROCESS/test; ls -lad 01_IN_PROCESS/test
drwxr-xr-x 2 root sys 96 Sep 17 08:44 01_IN_PROCESS/test
drwxr-xr-x 2 root sys 96 Sep 17 08:44 01_IN_PROCESS/test

hp-bugx:/8a/PROJECT >ls -lad 01_IN_PROCESS/test; chmod g+x 01_IN_PROCESS/test; ls -lad 01_IN_PROCESS/test
drwxr-xr-x 2 root sys 96 Sep 17 08:44 01_IN_PROCESS/test
drwxr-xr-x 2 root sys 96 Sep 17 08:44 01_IN_PROCESS/test

hp-bugx:/8a/PROJECT >ls -lad 01_IN_PROCESS/test; chmod 775 01_IN_PROCESS/test; ls -lad 01_IN_PROCESS/test
drwxr-xr-x 2 root sys 96 Sep 17 08:44 01_IN_PROCESS/test
drwxrwxr-x 2 root sys 96 Sep 17 08:44 01_IN_PROCESS/test
4 REPLIES 4

Re: chmod g+x fails but chmod 775 works to activate group execute bit.

Time to go back to UNIX basics school...

Your file already *has* group execute bit set (the second x in drwxr-xr-x for the file).

The last statement also set the group WRITE bit (the second w in drwxrwxr-x )

man chmod

would be a good start.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Weng Seng Tam
New Member

Re: chmod g+x fails but chmod 775 works to activate group execute bit.

Yeah. Its going to be a long night. I was focused on the wrong thing. :(
Weng Seng Tam
New Member

Re: chmod g+x fails but chmod 775 works to activate group execute bit.

I was focused on the wrong thing.

Re: chmod g+x fails but chmod 775 works to activate group execute bit.

Further explanation...

if your file already has permissions:

drwxr-xr-x

Then that is the equivalent of 755 in numerical format.

If you issue "chmod 775" on the file then all you are changing is the group write bit, so the equivalent of that is "chmod g+w"

HTH

Duncan

I am an HPE Employee
Accept or Kudo