beautypg.com

Executing scripts, Scripts executing scripts – Visara Master Console Center Scripting Guide User Manual

Page 18

background image

Chapter 1 Script Overview

Scripting Guide

18

Executing Scripts

There are four ways to execute a script:

ƒ

Manually. A user selects a script for immediate execution.

ƒ

Event Manager. Exec Script is one of the available actions for a
rule.

ƒ

Script. An executing script can initiate the execution of another
script. (See Scripts Executing Scripts following.)

ƒ

Reserved. Certain status changes automatically execute reserved
scripts. For example, the #startup script automatically executes at
MCC startup.

The file

/usr/ics/config/gclrund.txt

can be used to configure the

maximum number of concurrently executing scripts. The format of the file is
a single whole number in the range of 2 to 128 inclusive. If this file does not
exist, or if it contains invalid data, the value is defaulted to 35. When the
configured maximum number of concurrent scripts is reached, script
execution requests are queued. This script queue is a FIFO (First In First
Out) queue with a maximum of 4096 scripts.

Note: Reserved scripts are not subject to this limit, but are

executed immediately.

Scripts Executing Scripts

An executing script can initiate the execution of another script. There are
three ways to run a script from within another script, as described below:

Note: Remember that script names are case-sensitive;

“MYSCRIPT” is not the same as “myscript”.

Calling the Function Directly

The syntax (and the “rules”) for calling or executing another script from
within a script is the same as for calling a built-in command. For
example, the built-in HEXSTR() command requires one parameter—a
number—and has a return value of a string. The format in a script looks
like this:

$HexNum := HEXSTR( 15)

If a script is named MYSCRIPT and accepts one parameter—a number—
and has a return value of a string, the format for calling MYSCRIPT from
within another script looks like this:

$RetVal := myscript( 42)