我正在尝试使用bsub命令从tcl执行perl脚本。它执行了第一个命令,但之后它没有打印puts值,也没有执行其他命令。
eval [exec bsub -Ip -R "type=SPARC" -cwd /usr2/STATUS \
'/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_submit \
$c $T $E $review $Error $Reset $Analysis_Error \
$DFTDSM_Analysis_Error $LP_Analysis_Error']
puts "error entered"
eval [exec bsub -Ip -R "type=SPARC" -cwd /usr2/STATUS \
'/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_pldrc_submit \
$c $T $W $Lint_Review_warning $Lint_Must_warning $Lint_Reset_warning \
$DFT_Analysis_warning $DFTDSM_Analysis_warning $LP_Analysis_warning']
eval [exec bsub -Ip -R "type=SPARC" -cwd /usr2/SsATUS \
'/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_pldrc_submit \
$chip $TOP $runtime $run_time_lint_Review $run_time_lint_must \
$run_time_Lint_Reset $run_time_DFT_Analysis $run_time_DFTDSM_Analysis \
$run_time_LP_Analysis']
答案 0 :(得分:2)
我假设上面的代码是Tcl。我在这里看到一些问题:
您真的想要以下参数:
bsub
-Ip
-R
type=SPARC
-cwd
/usr2/STATUS
'/usr2/j/local/bin/perl5.6.1
/usr2/j/CAM_STATUS/auto_submit
$c
$T
$E
$review
$Error
$Reset
$Analysis_Error
$DFTDSM_Analysis_Error
$LP_Analysis_Error'
我想你想要exec bsub -Ip -R type=SPARC -cwd /usr2/STATUS "/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_submit $c $T $E $review $Error $Reset $Analysis_Error $DFTDSM_Analysis_Error $LP_Analysis_Error"
如果要进行变量替换,请使用"
进行分组,否则{}
(注意Tcl使用它自己的变量,如果你想要环境变量,请使用$ENV(FOO)
当子进程完成后,您将从exec
获得stdout。如果出现错误(某些内容写入stderr或返回代码!= 0),则会引发错误。如果是这种情况,请使用周围的catch
。如果您只是想将它打印到std *,您可以使用以下“参数”将std *从子进程重定向到std *通道:>@stdout 2>@stderr
所以我相信你的代码看起来应该或多或少(取决于你想要存档的内容):
exec bsub -Ip -R type=SPARC -cwd /usr2/STATUS "/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_submit $c $T $E $review $Error $Reset $Analysis_Error $DFTDSM_Analysis_Error $LP_Analysis_Error" >@stdout 2>@stderr
puts "error entered"
exec bsub -Ip -R type=SPARC -cwd /usr2/STATUS "/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_pldrc_submit $c $T $W $Lint_Review_warning $Lint_Must_warning $Lint_Reset_warning $DFT_Analysis_warning $DFTDSM_Analysis_warning $LP_Analysis_warning" >@stdout 2>@stderr
exec bsub -Ip -R type=SPARC -cwd /usr2/SsATUS "/usr2/j/local/bin/perl5.6.1 /usr2/j/CAM_STATUS/auto_pldrc_submit $chip $TOP $runtime $run_time_lint_Review $run_time_lint_must $run_time_Lint_Reset $run_time_DFT_Analysis $run_time_DFTDSM_Analysis $run_time_LP_Analysis" >@stdout 2>@stderr