【发布时间】:2014-12-16 01:30:52
【问题描述】:
我不知道如何使用expect发送箭头键,因此我为所有箭头键生成了autoexpect脚本,发现autoexpect为右箭头键生成了这个字符:
send -- "^[\[C"
我在自定义脚本中使用了相同的发送命令,但出现以下错误:
while executing
"send -- "^[\[C"
expect eof
"
(file "script_auto.exp" line 38)
我应该怎么做才能发送右箭头键。任何帮助将不胜感激。
【问题讨论】:
-
你是发送^ [还是转义?应该是 escape-[-C.
-
我只输入了右箭头并检查了autoexpect生成的脚本。上面提到的命令是由autoexpect生成的。
-
我尝试捕获右箭头键并得到
send -- "^[\[1;5C"。想知道为什么会有这种差异。无论如何,你可以试试send -- {^[\[C}吗? -
它没有给我任何错误,但它没有正确单击。
标签: networking tcl expect system-administration