I'd like to convert the Unix Permissions bits from octal to symbolic mode and viceversa. eg.:
$ mode-encode 'ugo+rwx' 0000 $ mode-decode 0000 ugo+rwx
I know there are online permission bits calculators and
chmod supports passing the bits in both ways, but i'd like a bash code snippet i can use with commands that does not support the symbolic mode.
EDIT: i'd like to get the permission bits, not the umask!