Detect Prompt
Detects whether an SSH-initiated command prompt is open or not according to the timeout entered.
Command availability: IBM RPA SaaS and IBM RPA on premises
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
terminalDetectPrompt [--timeout(TimeSpan)] (Boolean)=value
Dependencies
Connect to a terminal using the Connect to Terminal via SSH (terminalSshConnect
) command.
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Timeout | timeout |
Optional |
Time Span , Number , Text |
Maximum wait time for detection to take place. Note:If no value is defined for the
Timeout parameter, the bot uses the context timeout defined by the Set Timeout (setTimeout )
command. If that command is not used on the script, the default timeout is 5 seconds. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Result | value | Boolean |
Returns True if the connected terminal is open, or False otherwise. |
Example
Connects to an SSH terminal and checks if the terminal screen is open.
defVar --name terminalSshConnection --type Boolean
defVar --name verificationResult --type Boolean
terminalSshConnect --name "example" --host "example.com" --username example --password examplePassword --port 22 --timeout 00:00:05 terminalSshConnection=value
terminalDetectPrompt verificationResult=value
logMessage --message test --type "Info"
terminalDisconnect --name "example"