Scripting 等待某个单词的出现

Scripting 等待某个单词的出现,scripting,macros,teraterm,Scripting,Macros,Teraterm,我现在正在做一些teraterm脚本,我想等待某个大字符串中的某个单词,如果找到该单词,则执行一个命令,如果找不到,则执行另一个命令。我尝试使用wait和if_else,但它不起作用,请帮助。与我的实验一样,我发现waitln在处理大字符串时仍然可用。我使用waitln等待一个长度超过两个单词的字符串,并使用if…then…endif。与我的实验一样,我发现waitln在处理大字符串时仍然可用。我使用waitln等待长度超过两个单词的字符串,并使用if…then…endif。检查宏的超时时间。显

我现在正在做一些teraterm脚本,我想等待某个大字符串中的某个单词,如果找到该单词,则执行一个命令,如果找不到,则执行另一个命令。我尝试使用wait和if_else,但它不起作用,请帮助。

与我的实验一样,我发现waitln在处理大字符串时仍然可用。我使用waitln等待一个长度超过两个单词的字符串,并使用if…then…endif。

与我的实验一样,我发现waitln在处理大字符串时仍然可用。我使用waitln等待长度超过两个单词的字符串,并使用if…then…endif。

检查宏的超时时间。显式提供一些超时值

检查宏的超时时间。根据您的问题,明确提供一些超时值,我相信您可以在不使用if_else的情况下获得正确的解决方案。我一周前刚刚参与teraterm的脚本编写,到目前为止,我的经验和知识都是在COM端口通信方面。例如,我将显示要登录的代码片段:

;Set the COM port
connect '/C=5'

;Set Baud rate
setbaud 9600

;Set the display
showtt 1

;Set the timeout in seconds and result
timeout = 10
result = 1

;Set the username and password's prompt and value
UsernamePrompt='login:'
PasswordPrompt='Password:'
Username='admin'
Password='mypasword'

;Wait for the UsernamePrompt
wait UsernamePrompt
;If timeout occurs, result will be 0, else, result will be 1
if result = 0 goto Error
if result = 1 goto Ok

:Error
;Do the processing here if timeout occurs

:Ok
;Do the processing here if UsernamePrompt is received
sendln Username
我相信这会对你有所帮助。你可以到这里: 要了解超时和等待

祝你今天愉快


Hari

基于您的问题,我相信您可以在不使用if_else的情况下实现正确的解决方案。我一周前刚刚参与teraterm的脚本编写,到目前为止,我的经验和知识都是在COM端口通信方面。例如,我将显示要登录的代码片段:

;Set the COM port
connect '/C=5'

;Set Baud rate
setbaud 9600

;Set the display
showtt 1

;Set the timeout in seconds and result
timeout = 10
result = 1

;Set the username and password's prompt and value
UsernamePrompt='login:'
PasswordPrompt='Password:'
Username='admin'
Password='mypasword'

;Wait for the UsernamePrompt
wait UsernamePrompt
;If timeout occurs, result will be 0, else, result will be 1
if result = 0 goto Error
if result = 1 goto Ok

:Error
;Do the processing here if timeout occurs

:Ok
;Do the processing here if UsernamePrompt is received
sendln Username
我相信这会对你有所帮助。你可以到这里: 要了解超时和等待

祝你今天愉快


Hari

如何发送带有tera术语的内容并等待特定响应。翻阅tera术语的文档,经过长时间的搜索后发现tera术语的基本用法在任何地方都没有得到确切的解释,这有点令人沮丧。如何发送带有tera术语的内容并等待特定的响应。翻阅tera术语的文档,经过长时间的搜索,发现tera术语的基本用法在任何地方都没有得到确切的解释,这有点令人沮丧。