Var [var]

Syntax:

    var [<name> [<value>]]

Since 11.0.0

Lists, sets or removes variables.

If only the "var" command is given, all defined variables are listed.

If the command and the name of a variable is given, the variable is removed.

If the command, name and value is given, the variable is set to that value.

The following variables are automatically available:

Variable Description
${routername} Contains the current Router name set with the "sr" command.
${scriptpath} Contains the directory of the currently executing CLI script.

Example:

    >sr router1
    router1>substitute on
    router1>var myvar "Test"
    router1>var
    routername=router1
    myvar=Test
    router1>echo "This is a ${myvar}"
    This is a Test
    router1>_