The use of echo-e "\ 029"
does not work either.
But if use strg + alt gr + ] directly in a terminal session -> it works.
I have to ask my question more concretely:
I connect an RF generator (AGILENT) via Telnet/SCPI.
If I do this manual on terminal and press at the end of the session CTRL + ALT GR +] for '^]' then close the scpi session properly and I can type quit
to close the telnet session properly.
There is no error message on the display of the RF generator. So it should be.
如果我通过脚本执行此操作,SCPI 会话似乎无法识别中断信号条件“^]”,并且将在脚本结束后强制关闭(telnet 和 scpi)。 -> 消息:“被外部主机断开连接”。不幸的是,我在射频发生器的显示屏上收到错误消息 - >“无效标头”等。
连接成功后出现:
连接至192,168.10.66
转义字符是‘^]’ -> 这就是问题所在。终端中的手动输入工作正常,脚本不起作用。
我的脚本看起来像这样:
function getIDNMessage()
{
(
echo open $1 $2
sleep 1
echo "*IDN?"
sleep 1
echo –e "\029" # or echo “^]” does not work well
sleep 1
echo "quit\r"
sleep 1
) | telnet > scpi_telnet.log 2>&1
}
getIDNMessage 192.168.10.66 7777
在 Linux 上它实际上是:
CTRL + ] then ENTER
最后输入quit
命令。
^]
telnet> quit
Connection closed.
[fred@localhost ~]$
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)