Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Expect advice needed

Status
Not open for further replies.

TC2000

Programmer
Joined
Dec 28, 2000
Messages
32
Location
HK
How do I send "CTL-B" in expect command
 
Write a little expect script to show you what
your term driver sees when you type it.
It's simple:
Code:
#!/usr/bin/tclsh
package require Expect

spawn /bin/sh


   interact {
             "~q" {exit}
             "~n" {exp_internal 0}
             "~e" {exp_internal 1}
    }

Output from cntl-B
spawn id exp0 sent <\u0002>
spawn id exp4 sent <\u0007>
spawn id exp0 sent <\u0002>
spawn id exp4 sent <\u0007>
spawn id exp0 sent <\u0002>
spawn id exp4 sent <\u0007>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top