linux shell

#!/bin/bash
function menu {
clear
echo -e "Please input your select (0-3):"
echo -e "1. Disply 1.1"
echo -e "2. Disply 1.2"
echo -e "3. Disply 1.3"
echo -e "\n0. Exit"
read -p "Select:" option
}

while : do
menu
case $option in
0)
break;;
1)
pwd;;
2)
ls;;
3)
who;;
*)
clear
echo "请输入正确选项!";;
esac
done

执行后为什么有问题
/usercode/file.sh: line 27: syntax error near unexpected token done' /usercode/file.sh: line 27:done'

报错已经提示你了,这里有问题啊

img

你的语法问题啊。语法是这样的:

while argument; do
    statement
    ...
done

所以,你的分号去哪里了?