int search( list X, string pattern)
The search function returns the index of the first matching instance of pattern in the specified list. If there is no match, it returns -1.
The first element in the list is index:0.
The following example prints the index number for "cory", which is 1:
a=search({"jamie","cory","robyn"},"c*"); print(a);
j* |
j followed by any number of characters. |
j*e |
j followed by any number of characters, ending with an e. |
[jJ]* |
Upper or lower case j followed by any number of characters. |
[a-z] |
Any lower case character. |
[^a-z] |
Any character except lower case characters. |
j followed by a single character. |
list split ( string X [, string delimiter] string omit_empty_elements )
The split function is the opposite of join. It constructs a list by concatenating the strings into a list. It separates each element in the list with a delimiting character, which can be any character from the delimiter string. The default for delimiter is any white space character.
A sequence of two or more contiguous delimiter characters in the parsed string is considered to be a single delimiter. Delimiter characters at the start or end of the string are ignored.
The omit_empty_elements argument defaults to true. If specified and is false, the empty elements are not omitted from the resulting list.
The following example returns the list: {"jamie", "cory", "robyn"}
a = split( "jamie, cory, robyn", ", ")
list splitsubst( string X, string delimiter )
The splitsubst function splits a string X into a list. This function is similar to the split function except that the delimiter contains the entire delimiter string.
The following example returns the list: "john","jane,james"
a = splitsubst( "john,,jane,james", ",," )
These are the built-in miscellaneous functions available to use within the pmpolicy file.
Name | Description |
---|---|
atoi | Translate a string representation of an integer to an integer. |
authenticate_pam | Authenticate a user on the primary policy server. |
authenticate_pam_toclient | Authenticate a user on the client. |
basename | Return the filename portion of a path. |
comparehosts | Check whether a host string matches a host definition. |
datecmp | Compare two date strings. |
dirname | Return the directory name portion of a path |
feature_enabled | Determine whether a feature is supported on the policy server |
fileexists, access | Check whether a file or path exists on the policy server. |
Examine a list of arguments for short options to break up command lines for easier parsing. | |
Examine a list of arguments for short or long options to break up command lines for easier parsing. | |
Examine a list of arguments for only long options to break up command lines for easier parsing. | |
glob | Match a string to a pattern. |
ingroup | Check whether a host is in the specified UNIX group on the policy server. |
innetgroup | Check whether a user is in the specified NIS netgroup on the policy server. |
innetuser, inusernetgroup | Check whether a user is in the NIS netgroup or specified netgroup on the policy server. |
lineno | Return the current line number in the policy file. |
mktemp |
Create a temporary file. Same as mktemp system. |
osname | Return a string representation of the operating system. |
quote | Quote a string. |
rand | Generate a random number. |
stat | Obtain information about a file on the policy server. |
strftime | Format the current date/time as a string. |
system | Run a program on the policy server. |
timebetween | Check whether a given time is between two times. |
tolower | Convert string to lower case. |
toupper | Convert string to upper case. |
Return system information on the policy server; output of uname system command line. |
© 2024 One Identity LLC. ALL RIGHTS RESERVED. Conditions d’utilisation Confidentialité Cookie Preference Center