When using the classic CLI, an EHS script has the ability to define local (static) variables and uses basic .if or .set syntax inside the script. The use of variables with .if or .set commands within an EHS script adds more logic to the EHS scripting and allows the reuse of a single EHS script for more than one trigger or action.
Both passed-in and local variables can be used within an EHS script, either as part of the CLI commands or as part of the .if or .set commands.
The following applies to both CLI commands and .if or .set commands (where X represents a variable).
Using $X, without using single or double quotes, replaces the variable X with its string or integer value.
Using ‟X”, with double quotes, means the actual string X.
Using ‟$X”, with double quotes, replaces the variable X with its string or integer value.
Using ‛X’, with single quotes does not replace the variable X with its value but means the actual string $X.
The following interpretation of single and double quotes applies.
All characters within single quotes are interpreted as string characters.
All characters within double quotes are interpreted as string characters except for $, which replaces the variable with its value (for example, shell expansion inside a string).