A simple example how to "record" a session for later analysing and changing into a
real script.
Example 7-9. examples/expect/record.pl #!/usr/bin/perl
use strict;
use warnings;
use Expect;
my $exp = Expect->spawn("bash") or die "Cannot spawn bash child\n";
$exp->log_file($ARGV[0] || "record.log");
#$exp->raw_pty(1);
$exp->interact();
If you are interested in on-site trainings by the author, please
contact me directly.
|