jeudi 31 août 2017

Syntax error in executable pbs script

I have a pbs script that I am turning into an executable file then trying to run it, however, I am getting a syntax error. The syntax error is listened below:

./run_correlation_study.pbs: line 4: syntax error near unexpected token then' ./run_correlation_study.pbs: line 4: then'

Line 4 is the first line that says "then" under "if[i==0]". I have another pbs script called correlation_study.pbs that is executed in this script along with 3 command line parameters that are incremented by the for loops. I can't quite spot my syntax error though as my script looks similar to all the examples that I have looked at but something is obviously wrong. Below is my script:

    for((ARC_LENGTH = 1; ARC_LENGTH < 4; ARC_LENGTH++)); do
        for((i = 0; i < 4; i++)); do
           if[i==0]
             then
             qsub -v ARC_LENGTH_ARG=$ARC_LENGTH,NEUTRINO_BOUNDS=$i correlation_study.pbs
           elif[i==1]
           then 
           qsub -v ARC_LENGTH_ARG=$ARC_LENGTH,NEUTRINO_BOUNDS=$i correlation_study.pbs
           elif[i==2]
           then 
           qsub -v ARC_LENGTH_ARG=$ARC_LENGTH,NEUTRINO_BOUNDS=$i correlation_study.pbs
           elif[i==3]
           then 
           qsub -v ARC_LENGTH_ARG=$ARC_LENGTH,NEUTRINO_BOUNDS=$i correlation_study.pbs
           fi
        done
    done

Aucun commentaire:

Enregistrer un commentaire