四處錯誤:的Unix ELIF語法錯誤
syntax error near unexpected token `elif'
`elif [ "$PROJECT_DIR" = "Automation" ] then'
我在Unix行格式保存在Textpad ++所以我不知道是什麼問題...
#!/bin/bash
....
if [ "$PROJECT_DIR" = "Utility" ] then
echo "$PROJECT_DIR: Compiling..."
javac -sourcepath $SOURCE -classpath $CLASSPATH -d $OUTPUT $SOURCE/*.java -deprecation
echo "$PROJECT_DIR: Compiling..."
javac -sourcepath $SOURCE -classpath $CLASSPATH -d $OUTPUT $SOURCE/*.java -deprecation
elif [ "$PROJECT_DIR" = "Automation" ] then
echo "$PROJECT_NAME: Compiling..."
javac -sourcepath $SOURCE -classpath $CLASSPATH -d $OUTPUT $SOURCE/*.java
elif [ "$PROJECT_DIR" = "Sync" ] then
echo "$PROJECT_DIR: Compiling..."
javac -sourcepath $SOURCE -classpath $CLASSPATH -d $OUTPUT $SOURCE/*.java -deprecation
echo "$PROJECT_DIR: Compiling..."
javac -sourcepath $SOURCE -classpath $CLASSPATH -d $OUTPUT $SOURCE/*.java -deprecation
echo "$PROJECT_DIR: Compiling..."
javac -sourcepath $SOURCE -classpath $CLASSPATH -d $OUTPUT $SOURCE/*.java -deprecation
fi
好吧我其實試過了;之後],但我只是在第一次之後]並非全部。所以我把一個;落後所有]發生,現在它工作。謝謝。 – dave111