我正在编写以下代码:
if [ $opt -ge $max -o $opt -le 0 ]
then
echo "Bad";
else
echo "Good";
if [ $opt = "\" -o $opt = "/" ]
then
echo "Good";
else
echo "Invlaid"; //Line number 21
fi
fi //Line number 23 no Line number 24.
这显示一个错误:
./file.sh: line 21: unexpected EOF while looking for matching `"'
./file.sh: line 24: syntax error: unexpected end of file
如果我放置此代码:
if [ $opt -ge $max -o $opt -le 0 ]
then
echo "Bad";
else
echo "Good";
fi //Line number 23 no Line number 24.
然后就没有错误了。我无法弄清楚问题所在。