0
我有一个期望的脚本,给我使用右箭头的麻烦。 我的脚本的目标是为我们的客户自动安装一个程序。问题与右箭头键
使用autoexpect测试右箭头键返回:
发送 - “^ [\ [C”
我的脚本(预计5.43.0版本):
#!/usr/bin/expect --
if [ catch "spawn /mnt/install.sh" reason ] {
send_user "failed to spawn /mnt/install.sh script: $reason\n"
exit 1
}
expect {
timeout { send_user "Timeout reached! Aborting..."; return}
eof { send_user "\r\nInstallation complete!!\r\n"; return}
"*Demo*Expiration*Date*Reached*" {
sleep .5
send -- "^[\[C";
sleep .5
send "\r";
exp_continue
}
}
我当 “* Demo * Expiration * Date * Reached *”中的代码块执行时,请继续收到以下错误消息:
编译时丢失了括号结束 - “^ [\ [C”
我想我失去了一些东西基本在这里.....
THX!
谢谢glenn !!这里为我工作发送 - “\ 033 \\ [C”; – GoinOff
让我补充说我的TERM = linux工作,不会像vt100 – GoinOff