用bash编写循环脚本,但一直都失败了

时间:2013-10-28 05:50:31

标签: bash loops

我正在尝试编写循环脚本以同时运行2个作业并继续收到以下错误:

  

./ loop_script_test.sh:30行:寻找匹配时的意外EOF

     

./ loop_script_test.sh:line 55:语法错误:意外的文件结尾

我的脚本是:

source /node/procTestData/*/000scratch/*.io/*/logs_workflow/1_*.log

files="/node/procTestData/*/000scratch/*.io/*/logs_workflow/1_*.log |
/node/procTestData/*/*.io/*/logs_workflow/*.log

rundir="/node/procTestData/*/000scratch/ProductionwfTest.io/work* |
/node/procTestData/*/*.io/work*"

exitmessage=$(grep "volume created successfully" $runfile)
error1=$(grep "error" $files)
error2=$(grep "ERROR" $files)
error3=$(grep "SEVERE" $files)
error4=$(grep "severe" $files)
error5=$(grep "Error" $files)
error6=$(grep "Severe" $files)
error7=$(grep "WARNING" $files)
error8=$(grep "Warning" $files)
error9=$(grep "warning" $files)

wait

{
for file in $files
do

if [ ! -e '$files']
then

/d/sw/*/20130927/_ApplicationToRunOnData "'ProductionwfTest.proc' | 'workflow.proc'"

wait

$rundir/run_harness.sh;

wait

echo $files

wait

echo $error1
echo $error2
echo $error3
echo $error4
echo $error5
echo $error6
echo $error7
echo $error8
echo $error9
echo $exitmessage

fi
done

0 个答案:

没有答案