我不知道為什么在第 14 行出現語法錯誤。有誰知道為什么?
確切的錯誤:
./ABC.sh:第 14 行:意外標記“完成”附近的語法錯誤
./ABC.sh:第 14 行:“完成”
#!/bin/bash
echo "Please enter 1 character that is either 1, 2, or 3:"
read CHAR
while [ ! -z "$CHAR" ] do
case $CHAR in [A,a,1])
echo "This is A";;
[B,b,2])
echo "This is B";;
[C,c,3])
echo "This is C";;
[D-z])
echo "Sorry, the character you entered is not recognized, please try again";
esac
done
echo "You have entered an empty string, process terminated"
明天就要到期了,所以我真的很感激一些幫助。太感謝了!
uj5u.com熱心網友回復:
您的最后一個CASE條件未正確終止:
[D-z])
echo "Sorry, the character you entered is not recognized, please try again";
應該以 ;;
啊,你也錯過了;in :
while [ ! -z "$CHAR" ] ; do
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/382631.html
標籤:linux
下一篇:Linux:洗掉終止的行程
