Lantronix SLC 32 Lantronix SLC - User Guide - Page 111
Secondary Commands, send, send_user, expect, expect_user, expect_before, expect_background, return
View all Lantronix SLC 32 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 111 highlights
8: Devices send, send_user The send command sends output to a sub-process, The send_user command sends output to the standard output. Both commands have the same syntax: send send_user where can be either a quoted string or a variable reference. expect, expect_user, expect_before, expect_after, expect_background The expect command waits for input and attempts to match it against one or more patterns. If one of the patterns matches the input the corresponding (optional) command is executed. All expect commands have the same syntax: expect { {command 1} {command 2}... {command n}} where will either be a quoted string, a variable reference or the reserved word 'timeout.' The command x is optional, but the curly braces ('{' and '}') are required. If present it must be a primary command. return The return command terminates execution of the script and returns an optional value to the calling environment. Syntax: return where can be a word or a variable reference. Secondary Commands These are commands which provide data or other support to the Primary commands. These commands are never used by themselves in a script. The preprocessor will require that these commands always follow a left square bracket ('[') character and be followed on a single line by a right bracket (']'). string The string command provides a series of string manipulation operations. The string command will only be used with the set command to generate a value for a variable. There are nine operations provided by the string command. Syntax (varies by operation): string compare Compare two strings string match Determine if two strings are equal string first Find and return the index of the first occurrence of 'str_needle' in 'str_haystack' string last Find and return the index of the last occurrence of 'str_needle' in 'str_haystack' string length Return the length of 'str' string index Return the character located at position 'int' in 'str' SLC™ Console Manager User Guide 111