Declare the intention to use the programs required to get/set file permissions. Declaring the intention to use a program
The programs are: stat
, chmod
.
Print the access permissions for PATHNAME, in octal format.
The function variant _var
stores the result in the variable _RV, rather than print it;
Result variables.
mbfl_file_get_permissions /bin/ls -| 0755 mbfl_declare_varref(PERMS) mbfl_file_get_permissions_var mbfl_datavar(PERMS) /bin/ls "$PERMS" ⇒ 0755
To set permissions one may request the use of sudo
: just request a user before invoking
the following function. Executing a program
Set the access permissions for PATHNAME; MODE must be in a form accepted by
chmod
.
Execute the program chmod
with PERMISSIONS as permissions arguments and
PATHNAME as file system pathname argument. If the optional arguments OPT are present:
they are inserted as command line options.
Execute the program chmod
using the given optional arguments.
The following functions implement a very limited conversion between symbolic and octal access permissions representations.
This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.