Chat now with support
Chat with Support

Safeguard for Sudo 2.0 - Administrators Guide

One Identity Privileged Access Suite for Unix Introducing Privilege Manager for Unix Introducing Privilege Manager for Sudo Planning Deployment Installation and Configuration
Download Privilege Manager for Unix Software Packages Download Privilege Manager for Sudo Software Packages Quick Start and Evaluation Configure a Primary Policy Server Configure a Secondary Policy Server Install PM Agent or Sudo Plugin on a Remote Host Remove Configurations
Upgrading Privilege Manager 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 Troubleshooting Privilege Manager for Unix Policy File Components Privilege Manager Variables Privilege Manager for Unix Flow Control Statements Privilege Manager for Unix Built-in Functions and Procedures Privilege Manager Programs Installation Packages Unsupported Sudo Options Sudo Plugin Policy Evaluation About us


while ( expression ) statement

The while statement is a looping statement. It repeatedly executes the specified statement while the specified expression evaluates to true (any non-zero value). The while statement terminates when the specified expression evaluates to false (the value 0) or it encounters a break statement.

NOTE: The specified statement may not be executed if the specified expression initially evaluates to false (unlike the do-while statement, which always executes its specified statement at least once).

Use a statement block in the form { statement ... } to execute multiple statements in the loop. Quest recommends using a statement block for readability.


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

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

This prints the values 1,2,3,4,5 and uses a statement block:

x = 1; 
while (x <= 5) { 

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

while (x <= 5) { 
   if (x > 3) break; 

(See Use the While Loop for more usage examples.)

Privilege Manager for Unix Built-in Functions and Procedures

Privilege Manager for Unix Built-in Functions and Procedures

This section documents the syntax and usage of the built-in functions and procedures that are available to use within the policy file. They are listed in the following categories:

Environment Functions

These are the built-in environment functions available to use within the policy file:

Table 36: Environment functions
Name Description
getenv Return the value of an environment variable in runenv.
keepenv Remove all except the specified variables from the runenv.
setenv Set a runtime environment variable.
unsetenv Remove an environment variable from the runtime environment


string getenv ( string name [, string value] )

getenv returns the value of the specified environment variable from the runenv variable.

# print the value of HOME if defined, otherwise print "none" 
print(getenv("HOME", "none")); 
Related Topics




Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating