Can't send a Control-C character! 
Author Message
 Can't send a Control-C character!

        Hello,

        I am trying to write a script that will log into another
machine via telnet.  The system that I am trying to log into is rather
strange in that I have to send a control-c after typing the log in
name instead of a return.  I have the following code to do this:

# open a connection
set afile [open {|telnet connect.oclc.org} r+ ]

This guy, obviously, spawns a telnet session which can be read from
and written to as a file.  I then have a procedure that watches for
a certain string (this part works...).  When it sees the string I
want to send a string followed by a control-c.  I have tried
all of the following to no avail:

        puts $afile "string\3"
        flush $afile

        puts -nonewline $afile "string\3"
        flush $afile

        puts -nonewline $afile "string"
        puts -nonewline $afile "\3"
        flush $afile

        puts $afile "string\3"
        flush $afile

        puts $afile "string"
        puts $afile "\3"
        flush $afile

        None of the above combinations seem to be working at all.  I
did a small test script that writes "\3" to a regular file on my machine
and the control-c characters do appear when I more that file...

        Lost,
        Jason





Tue, 30 Dec 1997 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Send true '\r' character with expect

2. tcl/expect: '$' character in send command

3. How do you send special control characters to a printer in clarion5

4. How do I send control characters to a Receipt Printer in windows

5. Sending Control characters to printer port

6. sending the control character in expect

7. Sending Control characters to socket

8. sending control characters in expect

9. Sending Control characters

10. Send control character from Expect.

11. Sending control characters with Expect

12. Sending Control Characters in Expect

 

 
Powered by phpBB® Forum Software