这是我的perl脚本(a.pl)
#!/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脚本.. 有什么遗失
提前致谢..
答案 0 :(得分:2)
我建议您将system "./a.exp ";
替换为system qw(expect ./a.exp);
或者,您应该检查您的执行目录是否允许您引用./a.exp。