0
這裏的期望腳本是我的Perl腳本(a.pl)調用從Perl腳本
#!/usr/bin/perl
$logfile = "./a.log";
open(LOGFILE_Handle, ">$logfile") or die "Error : Can not open $logfile !!! \n\n ";
print LOGFILE_Handle "a.pl: 1 ";
system "./a.exp ";
這裏正在運行時,我想到的腳本(a.exp)
#!/opt/sfw/bin/expect -f
log_user 1;
set logfile "./a.log";
set LOGFILE_Handle [open "$logfile" "a" 0666]
puts $LOGFILE_Handle "a.exp: A"
send_user "Hi";
,Perl腳本,它不叫expect腳本.. 有什麼我在想念提前
謝謝..
您是否考慮過使用Perl Expect模塊? http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod – ghostdog74 2010-10-21 08:17:00