Some Device commands require users to answer a question before the command is executed. For example, the enable command on Cisco devices queries the user for a password before executing the command. For this reason, a command can optionally specify a QUERY which specifies the question asked by the device and the answer that should be given to the question. The QUERY is specified after the command within curly braces. For example,

shutdown { "Are you sure? ", "Y" }

The first value inside the curly braces is a String or Regular Expression describing the query prompt displayed by the device. The second value inside the curly braces is a String specifying the query response that should be entered in response to the query prompt. When the script interpreter executes this command, it will first send shutdown to the device. Next, it will wait until it receives the "Are you sure? " query prompt. Then, it will send Y to the device as the query response. Finally, the device will execute the command.

Note: Only Device commands can have a QUERY. Configuration Management commands do not need a QUERY and may not have one, with the exception of @logout.

@logout is the only Configuration Management command that supports an optional QUERY clause. This allows scripts to respond to device prompts that may occur when logging out (for example, confirmation prompts).

For example,

enable { $(PasswordPrompt), "$(Settings.PrivilegedPassword)" }

Note: The Configuration Management script language does not provide built-in timing or delay commands such as @pause or @wait. Scripts execute commands sequentially and rely on device responses and timeout settings (such as ReadTimeout) to control execution flow.