Prompt
The instruction PROMPT: should not be confused with the “object prompt”. Both are indeed prompts (the reason of keeping both with same name), but are used for different purposes.
The instruction PROMPT: is used when the automation flow is interrupted by the terminal/console request for user input. Let’s say that you enter a command, and the terminal requests your password (majority of the cases of using PROMPT:). You can use the PROMPT: instruction so sysopswork provides the password and continue with the automation.
In its simplest form, PROMPT: has the following syntax:
PROMPT: query$answer
The $
sign separates the query from the answer.
The query
is any word that sysopswork reads from the terminal for what the command requests. If the command you enter provides the following prompt:
Enter your password:
You can use password as your query
. It can be any word or part of the word that is requested by the terminal.
The answer
is the exact input you would type in the terminal/console enclosed within valid delimiters. The valid delimeters are: /, %, or |. In other words your answer should be provided as: /answer/, %answer%, or |answer|.
Say you enter a command that asks you the following question:
Would you like to proceed? (y/n)
And you want to answer y. Your PROMPT: instruction would look like:
PROMPT: proceed$/y/
Noticed that I took any word from the terminal request as a query. It could have been like or Would, but proceed is more relevant to the understanding of what is going on. I also picked the delimeter /. I could have picked the other delimeters if the delimeter would conflict with the answer that has to be provided.
You can also use your credentials for a specific object just by referring to them. For example, let’s say that your password for an object is “admin” (I hope this is not your real password). Instead of using the PROMPT: instruction as:
PROMPT: password$/admin/
You can use:
PROMPT: password$password
This does not mean that sysopswork will enter the word “password”. It means that sysopswork will use your password for the respective object (in this case “admin”), and enter it for this prompt.
The valid credentials are: $user, $password, and $enable (for second level passwords).
You can only use the credentials you already have for your object. For example, if the “login_mode” of an object is “key”, you evidently don’t have a $password to use wih your PROMPT: instruction.
Pagination
Pagination happens when the command you enter returns a long output that cannot fit within the terminal screen height, and instead of printing the entire result and scrolling all the way to the last line, the program gives you pages, where you have to press “Enter” or other key to see the next page. This situation is human-friendly, but breaks the flow of automation.
The ultimate solution is to disable pagination of any sort. Most vendor command line interfaces provide you a command to disable pagination. You must use it as the very first automation command.
Whenever this is not possible, the alternative is to use PROMPT: with the following syntax:
PROMPT: query
Where query
is any word prompting at the current output. When sysopswork sees a PROMPT: instruction without the $
sign, it understands this is a need to press “Enter” to continue with the flow of automation.
Unfortunatelly, there is no way for sysopswork to know how many pages the program returns, so you have to enter a PROMPT: instruction for each page, until it finishes providing the entire output.
Pagination might also lead to issues of sysopswork to analyze the results of the commands.