Chatee ahora con Soporte
Chat con el soporte

Privilege Manager for Unix 7.2.3 - Administration Guide

Introducing Privilege Manager for Unix Planning Deployment Installation and Configuration Upgrade Privilege Manager for Unix System Administration Managing Security Policy The Privilege Manager for Unix Security Policy Advanced Privilege Manager for Unix Configuration Administering Log and Keystroke Files InTrust Plug-in for Privilege Manager for Unix Troubleshooting Privilege Manager for Unix Policy File Components Privilege Manager for Unix Variables
Variable names Variable scope Global input variables Global output variables Global event log variables PM settings variables
Privilege Manager for Unix Flow Control Statements Privilege Manager for Unix Built-in Functions and Procedures
Environment functions Hash table functions Input and output functions LDAP functions LDAP API example List functions Miscellaneous functions Password functions Remote access functions String functions User information functions Authentication Services functions
Privilege Manager for Unix programs Installation Packages

for loop

Syntax
for ControlValue = StartValue to StopValue
[step increment] { initializer statements ; conditional expression ; update expression ; initializer statements ; conditional expression ; }
Description

The for statement is a looping statement. It runs one or more initializer statements and then evaluates the conditional expression. Use a comma to separate multiple initializer statements. If the conditional expression evaluates to true (any non-zero value), then it runs the specified statement. It runs the update expression (if present) immediately after it runs the specified statement. The for statement is terminated if the conditional expression evaluates to false (the value 0), or it encounters a break statement.

Typically, a for statement contains one initializer statement, a conditional expression, and an update expression that all operate on the same variable.

Use a statement block in the form { statement ... } to run multiple statements. One Identity recommends using a statement block for readability.

Examples

This prints the values 1,2,3,4,5:

for (x = 1; x <= 5; x++) print(x);

This prints the values 1,2,3,4,5. (Note that this example does not have an update expression and it uses a statement block):

for (x = 1; x <= 5; ) { 
   print(x); 
   x++; 
}

This prints the values 1,2,3 because the break statement terminates the loop:

for (x = 1; x <= 5; x++) { 
   if (x > 3) break; 
   print(x); 
}

for loop

Syntax
for (variable in expression ) statement
Description

The for statement is a looping statement. The specified expression must be an array. It runs the specified statement once for each array element, and assigns it to the specified variable in turn. The for statement terminates when the specified expression does not evaluate to an array value, either when each element of the array has been iterated, or it encounters a break statement.

Use a statement block in the form { statement ... } to run multiple statements. One Identity recommends using a statement block for readability.

Examples

This prints the values 1,2,3,4,5:

for (x in {1,2,3,4,5}) print(x);

This does not print any value, since the expression does not evaluate to an array:

for (x in "foo") print(x);

This prints the values 1,2,3 because the break statement terminates the loop:

values = {1,2,3,4,5}; 
for (x in values) { 
   if (x > 3) break; 
   print(x); 
}

function

Syntax
function ( parameter = expression, ... ) { statement ... }
Description

See procedure / function for a full description of function.

if-else

Syntax
if ( expression ) statement
if ( expression ) statement else statement
Description

The if-else statement is a conditional statement. It runs the specified statement if the specified expression evaluates to true (a non-zero value). If the else part is present, it runs the associated statement if the expression evaluates to false (the value 0).

Use a statement block of the form { statement ... } to run multiple statements. One Identity recommends using a statement block for readability.

Examples

Accept if the user is contained in the set of trusted users, otherwise continue execution at the next statement:

trustedusers = {"jamie","corey","robyn"}; 
if (user in trustedusers) 
   accept;

Accept if the user is contained in the set of trusted users, otherwise reject:

trustedusers = {"jamie","corey","robyn"}; 
if (user in trustedusers) 
   accept; 
else 
   reject;

Note the use of statement block to handle multiple statements:

trustedusers = {"jamie","corey","robyn"}; 
if (user in trustedusers) { 
   print("accepted"); 
   accept; 
} else { 
   print("rejected"); 
   reject; 
}
Documentos relacionados

The document was helpful.

Seleccionar calificación

I easily found the information I needed.

Seleccionar calificación