Ubuntu外壳脚本菜单
我不熟悉shell脚本/编程。我想创建一个显示以下内容的菜单:列出文件、时间和日期、日历、密码文件和退出。用户应该能够输入他们的选择和脚本响应。谢谢你的帮助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
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