title: Can't close a scpi(telnet) session with echo "^]" when I use it in a script
body: <p>The use of <code>echo-e "\ 029"</code> does not work either.
  But if use <kbd>strg</kbd> + <kbd>alt gr</kbd> + <kbd>]</kbd> directly in a terminal session -> it works.</p>
  
  <p>I have to ask my question more concretely:<br>
  I connect an RF generator (AGILENT) via Telnet/SCPI.<br>
  If I do this manual on terminal and press at the end of the session <kbd>CTRL</kbd> + <kbd>ALT GR</kbd> +<kbd>]</kbd> for '^]' then close the scpi session properly and I can type <code>quit</code> to close the telnet session properly.<br>
  There is no error message on the display of the RF generator. So it should be.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>My script looks something like this:</p>
  
  <pre><code>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 &gt; scpi_telnet.log 2&gt;&amp;1
  }
  
  getIDNMessage 192.168.10.66 7777    
  </code></pre>