ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

Misleading comments for `chmod` aliases #507

Closed willsawyerrrr closed 6 months ago

willsawyerrrr commented 6 months ago

The chmod aliases have their resultant permissions commented next to their definitions; however, the comments for the 644 and 755 commands are incorrect. See https://github.com/ohmybash/oh-my-bash/blob/master/aliases/chmod.aliases.sh#L7-L8.

Existing:

L7: alias 644='chmod 644'                       # -rw-r--r-- (user: rw, group: r, other: -)
L8: alias 755='chmod 755'                       # -rwxr-xr-x (user: rwx, group: rx, other: x)

Proposition:

L7: alias 644='chmod 644'                       # -rw-r--r-- (user: rw, group: r, other: r)
L8: alias 755='chmod 755'                       # -rwxr-xr-x (user: rwx, group: rx, other: rx)

Notice the inclusion of read permissions for others within the breakdown to the right.


Along a similar line, the uses of hyphens appear to be different between lines 6 and 10-11.

Line 6 seems to utilise a hyphen to indicate a lack of permissions for others.

Lines 10 and 11 seem to utilise hyphens to indicate a lack of change to existing permissions, showing that only executable permissions are modified.

Existing:

L 6: alias 640='chmod 640'                       # -rw-r----- (user: rw, group: r, other: -)
L10: alias mx='chmod a+x'                        # ---x--x--x (user: --x, group: --x, other: --x)
L11: alias ux='chmod u+x'                        # ---x------ (user: --x, group: -, other: -)

Proposition:

L 6: alias 640='chmod 640'                       # -rw-r----- (user: rw, group: r)
L10: alias mx='chmod a+x'                        # ---x--x--x (user: --x, group: --x, other: --x)
L11: alias ux='chmod u+x'                        # ---x------ (user: --x, group: -, other: -)