Ubuntu shell脚本菜单



我是shell脚本/编程的新手。我想创建一个菜单,显示以下内容:列表文件,时间和日期,日历,密码文件和退出。用户应该能够输入他们的选择和脚本响应。感谢任何帮助!!

while ((choice 1=5))
do
   clear
   echo "1. List all files"; echo
   echo "2. Display date and time"; echo
   echo "3. Calendar"; echo
   echo "4. Passwd file"; echo
   echo "5. Exit"; echo
   echo -n "Enter choice"
   read choice
   case $choice in
   1) ls -l;;
   2) date;;
   3) cal;;
   4) cat /etc/passwd;;
   5) echo "Thanks and goodbye!";;
   *) echo "1..5 only"
   esac
   sleep 3
done

最新更新