您能否运行以下代码并建议如何消除发生的错误?我在 cygwin 上运行代码

您能否运行以下代码并建议如何消除发生的错误?我在 cygwin 上运行代码
#!/bin/bash/

lpd_factor=1
beam_radius=.01 
defocus=0
power=1000
weld_speed=1.5

while [ `echo "$beam_radius<=.05"|bc -l` == 1 ]
do
  lpd_factor=1 
  while [ `echo "$lpd_factor<=3"|bc -l` == 1 ]
  do
    defocus=0
    while [ `echo "$defocus==0"|bc -l` == 1 ]
    do
      power=1000
      while [ `echo "$power<=1400"|bc -l` == 1 ]
      do
        weld_speed=1.5
        while [ `echo "$weld_speed<=2.6"|bc -l` == 1 ]
        do
          echo "Beam Radius = $beam_radius"
          echo "LPD Factor = $lpd_factor"
          echo "Defocus = $defocus"
          echo "Power = $power"
          echo "Weld Speed = $weld_speed"
          cp input.txt.back input.txt
          python change.py $beam_radius $lpd_factor $defocus $power $weld_speed
          wine run.exe
          python parsing.py
          weld_speed=`echo "$weld_speed+0.1"|bc -l`
        done
        power=`echo "$power+40"|bc -l`
      done
      defocus=`echo "$defocus+0.1"|bc -l`
    done
    lpd_factor=`echo "$lpd_factor+1"|bc -l`
  done
  beam_radius=`echo "$beam_radius+0.01"|bc -l`
done

答案1

这里明显的错误是shebang错了。应该是:

#!/bin/bash

并不是

#!/bin/bash/

失败的原因如下:

./script.sh
bash: ./script.sh: /bin/bash/: bad interpreter: Not a directory

相关内容