Я получил эту ошибку после выполнения сценария оболочки, как показано ниже.
$ ./script_test.sh
./script_test.sh: line 3: syntax error near unexpected token `$'do\r''
'/script_test.sh: line 3: `for ((j=0; j<"$N"; j++)) ; do
Сценарий ниже
#!/bin/sh
# This script will launch 10 simulations for each value of the PARAM1_LIST.
# Simulations results will be stored in folders named "myTest-i-j", where i
# is the effective value of the PARAM1_LIST for each simulation and j
# is the 1 to 10 repetition for each i.
N=10
PARAM1_LIST=(1 2 5 10)
for (( j = 0 ; j < $N; j++ )); do
for i in ${PARAM1_LIST[@]}; do
java -jar N3Sim.jar myConfigFile.cfg myTest-${i}-${j} $i
done
done