This section provides a list of invalid variable use in EHS syntax in classic CLI.
.set $srcAddr = "10.0.0.1"
where $srcAddr is a passed-in (dynamic) string variable
Reason: passed-in variables are read only inside an EHS script.
.set ($ipAddr = $numIngrPackets + $numEgrPackets)
where $ipAddr is a local (static) string variable
$numIngrPackets and $numEgrPackets are local (static) integer variables
Reason: variable types do not match, cannot assign a string to an integer.
.set ($numIngrPackets = $ipAddr + $numEgrPackets)
where $ipAddr is a local (static) string variable
$numIngrPackets and $numEgrPackets are local (static) integer variables
Reason: variable types do not match, cannot concatenate a string to an integer.
.set $ipAddr = "10.0.0.1"100
where $ipAddr is a local (static) string variable
Reason: when double quotes are used, they have to surround the entire string.
.if ($totalPackets == "10.1.1.1") {
.} endif
where $totalPackets is a local (static) integer variables
Reason: cannot compare an integer variable to a string value.
.if ($ipAddr == 10) {
.} endif
where $ipAddr is a local (static) string variable
Reason: cannot compare a string variable to an integer value.
.if ($totalPackets == $ipAddr) {
where $totalPackets is a local (static) integer variables
$ipAddr is a local (static) string variable
Reason: cannot compare an integer variable to a string variable.