Executes a command based upon which expression is true. This is similar to a giant set of if-then-elseif-elseif...else commands. Each expression is followed by a set of commands. Each expression is tested until one is found that is true. When one is found that is true, then the commands listed just after this expression are executed. If no expressions are true and there is an extra set of commands at the end, then this final "else" command is executed.
Note that you can implement an "else" clause at the end by using an expression of "1" or true. This will cause the final value to be returned if no other expressions matched.
To use the multiline syntax in TeSSH, the first expression and command must be on the same line as the #SWITCH, and each new expression and command must be on their own lines, indented from the first. For example:
A shortcut exists for switch commands that check a range of values of a single variable:
is equivalent to:
Add comment