我一直試圖解決這個錯誤2天,但我無法弄清楚錯誤發生在哪裏。你能幫我解決這個小小的錯誤嗎?使用bash腳本的語法錯誤
#!/bin/bash
ntests=10
param_vertexes=10
param_pop=10
echo -e "\nExecution of parallel with 8 threads for $ntests times."
par8_time=0
for i in $(seq $ntests); do
output=$(./parallel -t 8 $param_vertexes $param_pop)
echo $output
par8_time=$par8_time+$(echo $output | cut -d' ' -f6)
done
par8_time=$(echo $par8_time | bc)
echo "Total Iteration/Time: $par8_time"
echo "Speedup of 8 threads: $(echo -e "scale=10\n"$par8_time/$seq_time | bc)"
我不斷收到同樣的錯誤
Execution of parallel with 8 threads for 10 times.
Sequential iterations/time = 23.642725
Sequential iterations/time = 23.860021
Sequential iterations/time = 23.703970
Sequential iterations/time = 23.513577
Sequential iterations/time = 23.728710
Sequential iterations/time = 23.790608
Sequential iterations/time = 23.590524
Sequential iterations/time = 23.612470
Sequential iterations/time = 23.653072
Sequential iterations/time = 23.675878
Total Iteration/Time: 236.771555
(standard_in) 3: syntax error
Speedup of 8 threads:
正如你所看到的,只有問題與我的腳本是syntax error
尚未允許腳本來顯示加速比。
任何想法?提前致謝。
我試過,但它不能解決問題 – 2013-04-28 23:11:02
它給了我同樣的錯誤「語法錯誤」 – 2013-04-28 23:13:31