I've been banging my head off the wall trying to figure out why interact
doesn't recognize the escape sequence on Linux. Thus far, the only
results are holes in both my head and the wall, so I'd appreciate any
insight into the issue.
Thanks in advance.
Bryan
Source script:
#!/usr/bin/perl
use Expect;
my $exp = Expect->spawn("/usr/bin/bc");
print "Version = ", Expect::version(), "\n";
$Expect::Debug = 1;
$exp->debug(3);
$exp->interact(\*STDIN, "\027");
print "Interact exited\n";
Output from script:
Version = 1.11
Initialized STDIN.'
Initialized handle id(6).'
Escape seq. 'v' function for STDIN set to 'CODE(0x836f070)()'
Read handles:
Read handle: 'spawn id(3)'
Listen Handles: 'handle id(6)'.
Read handle: 'STDIN'
Listen Handles: 'spawn id(3)'.
Setting STDIN to tty mode '-g'
Setting tty for STDIN to 'raw -echo'.
Setting STDIN to tty mode 'raw -echo'
Attempting interconnection
interconnect: read 169 byte(s) from spawn id(3).
bc 1.05
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
Printed '\027' to spawn id(3) from STDIN.
interconnect: read 1 byte(s) from spawn id(3).
Printed 'q' to spawn id(3) from STDIN.
interconnect: read 1 byte(s) from spawn id(3).
qPrinted 'u' to spawn id(3) from STDIN.
interconnect: read 1 byte(s) from spawn id(3).
uPrinted 'i' to spawn id(3) from STDIN.
interconnect: read 1 byte(s) from spawn id(3).
iPrinted 't' to spawn id(3) from STDIN.
interconnect: read 1 byte(s) from spawn id(3).
tPrinted '\r' to spawn id(3) from STDIN.
interconnect: read 2 byte(s) from spawn id(3).
interconnect: read 1 byte(s) from spawn id(3).
Got EOF (spawn id(3) died) reading spawn id(3)
Setting STDIN to tty mode
'189:1280:13:35387:5:13:3:28:127:21:4:0:1:17:19:26:0'
Interact exited
Closing handle id(6).
Expect::soft_close('Expect=GLOB(0x8101ab0)') called at
/home/systest/lib/perl5/site_perl/5.6.0/Expect.pm line 1458
Expect::DESTROY('Expect=GLOB(0x8101ab0)') called at
/home/bryan/t.pl line 0
require 0 called at /home/bryan/t.pl line
|