Shell scrilpt:期望二进制运算符

时间:2018-07-20 06:20:42

标签: while-loop sh

我的shell脚本中有一个错误,我知道它在while循环中,但是我看不到它,我已经检查了空格。我也尝试使用test而不是括号,但是我有相同的错误

如果我评论while循环,我的代码将正常工作

line 45: [: -1e: binary operator expected

我的代码是

#!/bin/sh

# pe request
#$ -pe mpi_16 32 
#### 16 core : 'mpi_16 16' || 24 core : 'mpi_24 24 '

# our Job name 
#$ -N test3MD

#$ -S /bin/sh

#$ -q dulce.q
#### 16 core : '2687wv2.q'  || 24 core : '2697v2.q'

#$ -V

#$ -cwd

# needs in 
#   $NSLOTS          
#      the number of tasks to be used
#   $TMPDIR/machines 
#       a valid machiche file to be passed to mpirun 
#   enables $TMPDIR/rsh to catch rsh calls if available

echo "Got $NSLOTS slots."
cat $TMPDIR/machines

################ mpi execute #############################
MPI_HOME=/opt/intel/impi/4.0.0.028
MPI_EXEC=$MPI_HOME/bin64/mpirun
 cd $SGE_O_WORKDIR

rm ./POTCAR
cat /share/VASP_POTCAR/PAW_PBE_VASP52/C/POTCAR >./POTCAR
cat /share/VASP_POTCAR/PAW_PBE_VASP52/Li/POTCAR >>./POTCAR

runVASP=/opt/vasp/vasp.5.4/vasp.5.4.1/bin/vasp_std
runVASP_NonCol=/opt/vasp/vasp.5.4/vasp.5.4.1/bin/vasp_ncl
runVASP_GAMMA=/opt/vasp/vasp.5.4/vasp.5.4.1/bin/vasp_gam


  i=1

  while [ $i -1e 10 ] 
  do
     cp POSCAR  POSCAR.$i
     $MPI_EXEC -machinefile $TMPDIR/machines -n $NSLOTS $runVASP > stdout
     cp CONTCAR POSCAR
     cp REPORT REPORT.$i
     cp HILLSPOT PENALTY
     let i=i+1
  done

谢谢

0 个答案:

没有答案