Syntax
int sub ( string <regexp> string replacement string sourcestring string count)
Description
sub returns a new string from the sourcestring argument with the specified regular expression regexp replaced with the string specified in the replacement argument.
Example
result = sub("0x[[:xdigit:]]*:,"hex","These are numbers: 0xA8D, 0x34");
Syntax
string subst ( string str, string pattern, string replacement )
Description
subst substitutes part of a string with another string.
Example
print(subst("xxxonexxx","one","two"));
Returns: "xxxtwoxxx"
Syntax
string substr ( string str, int start, int length )
Description
substr returns the substring of a given length starting at a given position in the string.
Example
printf("%s\n",substr ("xxxfooxxx",3,3))
Returns "foo".
printf(%s\n",substr (xxxfooxxx",3,-1))
-1 returns the remainder of the string, "fooxxx".
These are the built-in user information functions available to use within the pmpolicy file.
Table 46: User information functions
getfullname |
Get a user’s full name from the policy server. |
getgroup |
Get a user’s primary group from the policy server. |
getgroups |
Get the list of groups for a user from the policy server. |
gethome |
Get a user’s home directory from the policy server. |
getshell |
Get a user’s login shell from the policy server. |