Input/Output

input

Description

The input() function prompts the user for a single line of input. There is no default prompt. If the user attempts to enter more than a single line of input, then the excess input is ignored.

Syntax

result = input (prompt);

Arguments

prompt Required. A character string that contains the prompt displayed to the user.

Return values

result is a character string that contains the single line of input that is typed by the user.

Example

In this example, the prompt Please enter you first and last name: is displayed to the user. The resulting input is stored in result.

result = input ("Please enter your first and last name:");

ℹ️

Note

For more information, see the following:

inputnoecho

inputnoecho

Description

The inputnoecho() function prompts the user for a single line of input. There is no default prompt. It ignores excess input if the user supplies more than one line of input.

The inputnoecho() function works like the input() function, except that the input that is typed by the user is not shown on the terminal. This function is useful when prompting the user for a password or other types of confidential information.

Syntax

result = inputnoecho (prompt);

Arguments

NameDescription
promptRequired. Character string containing the prompt displayed to the user.

Return values

result is a character string that contains the single line of input that is typed by the user.

Example

result = inputnoecho ("Please enter your first and last name:");

In this example, the prompt Please enter you first and last name: is displayed to the user. The resulting input is stored in result.

ℹ️

Note

For more information, see input.

print

Description

The print procedure writes one or more expressions to the user’s terminal as a single line. The line terminates with a newline character. A comma separates each argument. If an integer is supplied as an argument, then its value is automatically converted to a character string. If a list is supplied, then it prints as a series of quoted strings with the entire series between braces.

The print and printnnl procedures work in the same manner. The only difference is that print terminates the generated character string with a newline character, whereas printnnl does not.

Syntax

print (expression1 [, expression2, …]);

Arguments

NameDescription
expression1Required. A value that is displayed to the user.
expression2, …Optional. Additional values that are displayed to the user.

Return values

Because print is a procedure, no return value is set.

Example

In the first example,

print ("Your task request has been accepted.", "Thank you.");

writes the following to the user's terminal:

Your task request has been accepted. Thank you.

This line terminates with a newline character.

The second example,

TrustedUsers = {"JWhite", "TBrown", "SBlack"};
print ("The trusted users are:", TrustedUsers);

writes the following on the user’s terminal:

The trusted users are: {"JWhite", "TBrown", "SBlack"}

This line terminates with a newline character.

See also

fprintf, outputredirect, printf, printnnl, sprintf(), syslog

printf

Description

The printf procedure creates a character string by formatting the supplied arguments according to the formatting commands in a format control string. The resulting character string is written to the user’s terminal.

The format control string controls the generation of the character string that is written to the user’s terminal. It consists of two types of information: actual content and format command characters. The format command characters are used to insert and format the supplied arguments. The number of format command characters in the format control string must match the number of supplied arguments. In other words, if there are three formatting commands in the format control string, then three function arguments are needed. Otherwise, an error is generated.

ℹ️

Note

For more information on format command characters, see Format Commands.

Syntax

printf (controlstring [,arugment1, …]);

Arguments

NameDescription
controlstringRequired. Character string that contains the format control string that is used to
generate the formatted string that is returned in result.
argument1 …Optional. Character strings and/or integer values to substitute into the formatted string.

Return values

Because printf is a procedure, no return value is set.

Example

In this example,

printf ("System administrator Ids: %s %s %s\n", "JWhite", "TWhitman", "EPipes");

the following string is printed:

System administrator Ids: JWhite TWhitman EPipes

See also

fprintf, outputredirect, print, sprint(), syslog

printnnl

Description

The printnnl procedure writes one or more expressions to the user’s terminal as a single line. The line does not terminate with a new line character. A space separates each argument.

The print and printnnl procedures work in the same manner. The only difference being that print terminates the generated character string with a newline character, whereas printnnl does not.

Syntax

printnnl (expression1 [, expression2, …]);

Arguments

NameDescription
expression1Required. An expression that contains the information to display to the user.
expression2Optional. Additional expressions to display to the user.

Return values

Because printnnl is a procedure, no return value is set.

Example

In the example,

printnnl ("Your task request has been accepted."); print ("Thank you.");

writes the following to the user's terminal:

Your task request has been accepted. Thank you.

The text that is printed by printnnl is not terminated with a newline character, so the text that is printed with print appears on the same line.

See also

fprintf, outpuredirect, print, printf, sprintf(), syslog

printvars

Description

The printvars procedure prints all user and EPM variables to the user’s terminal. This function is often useful when debugging security policy files.

Syntax

printvars();

Arguments

There are no arguments.

Return values

Because printvars is a procedure, no return value is set.

Example

printvars();

©2003-2025 BeyondTrust Corporation. All Rights Reserved. Other trademarks identified on this page are owned by their respective owners. BeyondTrust is not a chartered bank or trust company, or depository institution. It is not authorized to accept deposits or trust accounts and is not licensed or regulated by any state or federal banking authority.