发新话题
打印

shell编程例子 -- 一个简单的目录菜单

shell编程例子 -- 一个简单的目录菜单

  shell编程例子 -- 一个简单的目录菜单


转来的 放在这里注意的人多点

本文作者: 不祥

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
Never say die !!! 高调做事,低调做人!! 暂负此心,只为不负此生; 暂负一时,只为不负一世。
发新话题