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.
If I do this via script the SCPI session seems not to recognize the break signal condition '^]' and will be forced to close after the end of the script (telnet and scpi). -> Message: "Disconnected by foreign host". Unfortunately, I get error messages on the display of the RF generator -> "invalid header", etc.
After successful connection appears: Connected to 192,168.10.66 Escape Character is ‘^]’ -> This is the point at issue. Manual entry in the terminal works correctly, script does not work.
My script looks something like this:
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
To exit the Telnet session, type Ctrl + ] on your keyboard. This changes the command prompt to show as telnet>. Back in the terminal, type in the word 'close' to close the session.
Answer: To end your current telnet session you must reach the telnet prompt and type quit. Here are the steps for doing so: Open the telnet prompt by holding down the 'Ctrl' key and push the ']' key.
On Linux it's actually:
CTRL + ] then ENTER
Finally type in the quit
command.
^] telnet> quit Connection closed. [fred@localhost ~]$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With