Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu外壳脚本菜单_Ubuntu - Fatal编程技术网

Ubuntu外壳脚本菜单

Ubuntu外壳脚本菜单,ubuntu,Ubuntu,我不熟悉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 e

我不熟悉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