how do I sent escape character ^] through a spawned telnet session?

user2840240

I am able to open a spawned telnet session in a shell script to run some commands. Afterwards, I am trying to send the escape character using send (see syntax below) but it never gets to the part where I am able to close the session. Can someone point me in the right direction? Due to this issue, I am opening up multiple telnet sessions this way, which I do not want to do.

send "^]\r"
expect "telnet>"
send "close\r"
close $spawn_id 
glenn jackman

You send the ESC control sequence. Try send "\x1b\r"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Telnet: How do I un-escape?

From Dev

How do I escape a special Regex character?

From Dev

How do I escape an escape character with ANTLR 4?

From Dev

How do I stop a telnet session from timing out?

From Dev

How can I tell if a shell is spawned by sFTP with "Escape to local shell"?

From Dev

How do I detect collision with spawned objects?

From Dev

How do I detect collision with spawned objects?

From Dev

how do I write to a spawned terminal?

From Dev

How do I concatenate text that contains the escape character "\"

From Dev

How do I split a whitespace delimited string of tokens with an escape character?

From Dev

How do I escape a certain character in a variable in a batch file

From Dev

Shortcut to send telnet session to background conflicts with Cisco terminal shortcut: Ctrl+Z.How do I change that?

From Dev

Do I need to escape dash character in regex?

From Dev

How do I hold a session through a PHP login redirect?

From Dev

How do you conditionally check for an escape character?

From Dev

How do I get the pid of a spawned process using pexpect?

From Dev

How do I get the pid of a spawned process using pexpect?

From Dev

How can I escape character '&' in Path in XAML?

From Dev

How do I disable telnet on Ubuntu Server?

From Dev

How do I disable telnet on Ubuntu Server?

From Dev

.NET Regex: How do I include "end of string only" character escape in a bracket expression?

From Dev

How do I use string formatting with explicit character escape codes in Python?

From Dev

q/kdb: How do I break my code into lines. Is there a new line 'escape' character or something similar?

From Dev

How do I rename an 8 character file to a 9 character file through batch script?

From Dev

How do I display UTF-8 characters sent through a websocket?

From Dev

How do I check if a message sent through socket-io is read?

From Dev

How to terminate tmux session and processes it spawned

From Dev

How do terminal size changes get sent to command line applications though ssh or telnet?

From Dev

How to Install telnet through a file?

Related Related

  1. 1

    Telnet: How do I un-escape?

  2. 2

    How do I escape a special Regex character?

  3. 3

    How do I escape an escape character with ANTLR 4?

  4. 4

    How do I stop a telnet session from timing out?

  5. 5

    How can I tell if a shell is spawned by sFTP with "Escape to local shell"?

  6. 6

    How do I detect collision with spawned objects?

  7. 7

    How do I detect collision with spawned objects?

  8. 8

    how do I write to a spawned terminal?

  9. 9

    How do I concatenate text that contains the escape character "\"

  10. 10

    How do I split a whitespace delimited string of tokens with an escape character?

  11. 11

    How do I escape a certain character in a variable in a batch file

  12. 12

    Shortcut to send telnet session to background conflicts with Cisco terminal shortcut: Ctrl+Z.How do I change that?

  13. 13

    Do I need to escape dash character in regex?

  14. 14

    How do I hold a session through a PHP login redirect?

  15. 15

    How do you conditionally check for an escape character?

  16. 16

    How do I get the pid of a spawned process using pexpect?

  17. 17

    How do I get the pid of a spawned process using pexpect?

  18. 18

    How can I escape character '&' in Path in XAML?

  19. 19

    How do I disable telnet on Ubuntu Server?

  20. 20

    How do I disable telnet on Ubuntu Server?

  21. 21

    .NET Regex: How do I include "end of string only" character escape in a bracket expression?

  22. 22

    How do I use string formatting with explicit character escape codes in Python?

  23. 23

    q/kdb: How do I break my code into lines. Is there a new line 'escape' character or something similar?

  24. 24

    How do I rename an 8 character file to a 9 character file through batch script?

  25. 25

    How do I display UTF-8 characters sent through a websocket?

  26. 26

    How do I check if a message sent through socket-io is read?

  27. 27

    How to terminate tmux session and processes it spawned

  28. 28

    How do terminal size changes get sent to command line applications though ssh or telnet?

  29. 29

    How to Install telnet through a file?

HotTag

Archive