#! /bin/bash
count=1
step=(a b)
for x in 0 1
do
if [[ $count != '0' ]]; then
if [[ ${step[x]} = "a"]]; then
echo "Python test ($count)"
else
echo "stress test"
fi
fi
done
我收到以下錯誤bash腳本:怎樣才能使用嵌套如果在一個for循環
syntax error in conditional expression: unexpected token `;'
line 20: syntax error near `;
line 20: ` if [[ ${step[x]} = "a"]]; then'
爲什麼?
第9行如何成爲第20行? – ocodo 2011-02-02 22:15:57