意外标记“0”附近的语法错误

Gre*_*sym 1 bash shell syntax-error exit

好的,我知道 bash 新人已经发布了很多,但是,这是老师给我的程序,它无法正常工作。

#! /bin/bash
echo "month"
read month
case $month in
   january)
       echo "31" ;;
   february)
       echo "30" ;;
   *)
       echo "INVALID" ;;
esac
exit(0)
Run Code Online (Sandbox Code Playgroud)

终端给了我两个错误,

./shell2:第 15 行:意外标记“0”附近的语法错误

./shell2:第 15 行:`退出(0)'

有人可以给我解释一遍吗?谢谢

Har*_*nry 6

在 bash 中,参数没有放在大括号中。它应该exit 0代替exit(0)