|
From: <RGi...@a1...> - 2002-02-28 09:38:02
|
> I am having two problems. The first is that I can't get it
> to not echo the text - including the passphrase - in the
> resulting output.
Where? On stdout? Use $exp->log_user(0). In the text that gets
expected upon? Set to raw.
> The line:
>
> $exp->slave->stty ( qw(raw) );
>
> produces the error:
>
> Can't locate object method "stty" via package "IO::Tty"
> (perhaps you forgot to load "IO::Tty"?) at
> /data/home/tuser/cgi-wrap/nbpExtract.cgw line 53.
Which version of IO::Tty is installed? I only recently added IO::Stty
to its @ISA. Is IO::Stty installed properly?
I just uploaded a new beta version (IO-Tty 0.97_01, Expect 1.13_07)
that has new methods dealing with setting the pty to 'raw'. Please
download that and try
$exp = new Expect;
$exp->raw_pty(1);
$exp->spawn(...) or die ...
> Secondly, the information I need is literally the very
> last thing gpg spits out. So there is no pattern to
> match other than end of file. How do I grab everything
> from after the passphrase was put in to where the
> program quit?
Just expect for the line that is spit out immediately before the
interesting stuff, then do a
my @lines
$exp->expect($timeout,
['.*\n',
sub { my $self = shift;
push @lines, $self->match();
exp_continue; }
],
['eof', sub {}]);
to gather the lines.
Hope this helps,
Roland
--
RGi...@cp...
|