免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4412 | 回复: 2
打印 上一主题 下一主题

perl 执行时报 then: then/endif not found. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-31 20:48 |只看该作者 |倒序浏览
d/% ./et.pl
then: then/endif not found.
user1/pass  , sqlplus  

该脚本内容应该没有问题,用了好多年,而且其他服务器上跑得都没有问题!

脚本关键部分如下,不知道为什么一执行就报 then: then/endif not found ,然后$strPolDir =~ "/opt/nokianms/bin/ 执行也不对了

#***************************************
#  For IT environment get SQLPLUS omc
#  PWD from polpasmx.
#*#**************************************
my $strPolDir=`which polpasmx`;
my $user = "";
my $pass = "";
if ( $strPolDir =~ "/opt//bin/" )
{
    my $pol=`polpasmx -omc`;
    chomp($pol);
    $user = "omc";
    $pass = $pol;
print "user/pass $user , $pass";
}
else {print "user1/pass $user , $pass";
}


#*********************************************
# When lock is available, clean-up is started
#*********************************************
my $boolError = 0;
if (0 == 0)
{
    open(outfile , "> /var/opt/nokiaoss/log/pm_cleanup.log");
print "sqlpous $user,$pass";
#   print outfile `sqlplus -S $user/$pass @/opt/reporter/etload/lbin/etload_meas_clean.sql`;  
    close(outfile);

论坛徽章:
0
2 [报告]
发表于 2007-09-03 14:35 |只看该作者
#*********************************************
# When lock is available, clean-up is started
#*********************************************
my $boolError = 0;
if (0 == 0)
{
    open(outfile , "> /var/opt/nokiaoss/log/pm_cleanup.log");
print "sqlpous $user,$pass";
#   print outfile `sqlplus -S $user/$pass @/opt/reporter/etload/lbin/etload_meas_clean.sql`;  
    close(outfile);


结尾少一个 }

论坛徽章:
0
3 [报告]
发表于 2007-09-04 13:10 |只看该作者

看文件第一行,perl路径是否指定正确了.

then endif应当是shell里面的东西.
猜测你的文件第一行被破坏了.
导致这个东西被默认当成shell脚本来解释.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP