DELL Version 5.3 User Manual
420
Perl Scripts | Actions and Adaptive CLI
If you set the
<mandatory>
Attribute to interface and set
[optional]
to brief then the resulting
command would be:
show interface brief
Conditional Blocks
Every line in the script is presumably a command to be sent to the device, except for lines that
denote either a beginning or ending of a conditional block.
The begin conditional block marker is tied to a Attribute and has the following syntax:
The begin conditional block marker is tied to a Attribute and has the following syntax:
<optional-open-delimiter> IF optional-attribute <optional-close-delimiter>
The end conditional block marker has the following syntax:
<optional-open-delimiter> ENDIF optional-text < optional-close-delimiter>
Here is an example of a conditional block, where the Attribute delimiters are <>, optional delimiter
is [], and the conditional Attribute variable is set:
[IF set]
execute this command
and execute this command
[ENDIF set]
If the Attribute set has a value then the block is evaluated; otherwise, it is ignored. The text after
ENDIF
ENDIF
., that is set or whatever is not required and it is ignored.
Nested conditional blocks are allowed.
Perl Scripts
This section describes the details of using Perl scripts within Adaptive CLI. See Using Perl in
Adaptive CLI on page 396 for more about why to use Perl.
The Perl output goes to the selected target device. Typically, this means creating lines like the
The Perl output goes to the selected target device. Typically, this means creating lines like the
following:
println(“show $param”);
or
print(“show $param\n”);
You must specify parameters within the script (like $param) in the screen described in Attributes
on page 404. Unlike its internal scripts, Adaptive CLI does not automatically create attributes. You
must also manually configure created attributes to be Mandatory, or Optional in that screen.
A few things to remember when using Perl:
A few things to remember when using Perl:
• The normal output of your Perl scripts (to stdout) are the commands sent to a device by this
application.