Copyright © 2010, Juniper Networks, Inc.
Table 51: Environment Commands
Command
env.delay(int delay)
env.getLine
env.getLine(string
prompt-string)
env.getLineMasked
env.getLineMasked(string
prompt-string)
env.argc
env.argv(n)
env.argv(0)
env.atoi(string)
env.atoi(env.argv(n))
env.setResult
env.getErrorCommand
env.getErrorStatus
env.startCommandResults
env.stopCommandResults
env.getResults
env.regexpMatch(string)
env.getRegexpMatch(string)
Description
Causes the macro to delay further execution for the number
of seconds specified by delay
Prompts the user with a question mark (?) and waits for a
response
Prompts the user with the value of prompt-string and waits for
a response
Prompts the user with a question mark (?), waits for a
response, and echoes the response with an asterisk (*) for
each character entered by the user
Prompts the user with the value of prompt-string, waits for a
response, and echoes the response with an asterisk (*) for
each character entered by the user
Returns the number of arguments passed to the macro
Returns the value of the nth argument, such that 1 <= n <=
env.argc
The returned value is a string, not a number; if you want to use
this value for a subsequent numeric operation, you must first
convert it to a number with the env.atoi(string) command
Returns the name of the macro
Converts the specified string to a numeric value
Converts input values to integers
Sets parameters within a macro for display through the
macroData log at the NOTICE severity level following the
completion of the macro
Returns the command string that triggered a macro error
Returns the reason for a triggered error
Starts the capture of command output
Stops the capture of command output
Returns one line of output from the capture buffer
Checks a string against a regular expression
Extracts a string from a larger string
Chapter 8: Writing CLI Macros
461
Need help?
Do you have a question about the JUNOSE SOFTWARE FOR E SERIES 11.3.X - SYSTEM BASICS CONFIGURATION GUIDE 2010-10-04 and is the answer not in the manual?
Questions and answers