echo "Which number port would you like to power up or down? 1, 2 or 3?"
read string
case "$string" in
    [1]* | [2]* | [3]*) echo "User entered: '$string'" ;;
    *) echo "I don't understand '$string'" ;;
esac


谁能阐明为什么这行不通? Bash的新手。

最佳答案

您确定没有“不可破坏的空间”(https://en.wikipedia.org/wiki/Non-breaking_space)吗?
例如*)和echo之间

关于linux - “意外 token ')'附近的语法错误”?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52970850/

10-16 13:51