This provides you a great amount of flexibility to accept variable responses and pick out only the information you need. This is accomplished using special control characters and regular expressions. If you do not need all this flexibility or are new to writing your own custom TCP/UDP scripts then you may want to start off using the SimpleExpect keyword first.
The Expect syntax has the form
Expect=Response where the Response is either
specified as an exact text string or a mixture of regular expression rules and text. The Add/Edit Expect Rule button will help you
construct and test a regular expression response string. It will
automatically choose the variation of Expect for you based on
options you select in that dialog. The Add/Edit Expect Rule button does not aid in
the generation of SimpleExpect keywords.
WhatsUp Gold v7 or v8 users: The
= = codes have been replaced with variations on
the Expect keyword itself. Migrated definitions will be converted
# Note: script comments start with a # character
# Send a simple text command
Send = Hello There
# Expect a nice response that begins with, "Hi, How are you"
Expect=^Hi, How are you
# Send a command followed by CR/LF
Send=Select * from Accounts\r\n
# Expect a large response, but we only care to check that somewhere
# in the response John Doe is mentioned
# Send a binary escape (27) and an x y and z and then a nak (21)
# Expect something that does *not* contain 123 escape (27)