until
echo List Directory..........1
echo Change Directory........2
echo Edit File...............3
echo Remove File.............4
echo Exit Menu...............5
read choice
test $choice = 5
do
case $choice in
1) ls;;
2) echo Enter target directory
read dir
cd $dir
;;
3) echo Enter file name
read file
vi $file
;;
4) echo Enter file name
read file
rm $file
;;
q|Q|5) echo Goodbye;;
*) echo illegal Option
esac
Linux shell编程例子 -- 一个简单的目录菜单
于 2023-06-29 11:04:39 首次发布
本文展示了一个使用Linux Shell编程实现的简单目录菜单,包括列出目录、切换目录、编辑文件和删除文件等操作。用户通过选择相应的编号来执行命令。文章还提及了Linux运维的实战应用和基础入门知识。
摘要由CSDN通过智能技术生成