return

return statusCode
Note

Note

This is a script command and operates only in scripts or on the command line when scripting is enabled with the following command: enable cli scripting {permanent} .

Description

Exits the current script and sets the $STATUS variable.

Syntax Description

statusCode Specifies a integer value to which the $STATUS variable is set.

Default

N/A.

Usage Guidelines

When used in nested scripts, this command allows you to terminate the current script, set the $STATUS variable, return to the parent script, and evaluate the $STATUS variable in the parent script. For more information on the $STATUS variable, see “Using CLI Scripting” in the ExtremeXOS 31.7 User Guide .

Example

The following example exits the current script and sets the $STATUS variable to -200:
return -200

History

This command was first available in ExtremeXOS 12.4.

Platform Availability

This command is available on ExtremeSwitching X435, X440-G2, X450-G2, X460-G2, X465, X590, X620, X670-G2, X690, X695, X870, 5320, 5420, and 5520 series switches.