shell编程例子--一个简单的目录菜单
2006-03-05 11:32:55 来源:WEB开发网核心提示:untilechoListDirectory..........1echoChangeDirectory........2echoEditFile...............3echoRemoveFile.............4echoExitMenu...............5readchoicetest$
until
echoListDirectory..........1
echoChangeDirectory........2
echoEditFile...............3
echoRemoveFile.............4
echoExitMenu...............5
readchoice
test$choice=5
do
case$choicein
1)ls;;
2)echoEntertargetdirectory
readdir
cd$dir
;;
3)echoEnterfilename
readfile
vi$file
;;
4)echoEnterfilename
readfile
rm$file
;;
q|Q|5)echoGoodbye;;
*)echoillegalOption
esac
done
echoListDirectory..........1
echoChangeDirectory........2
echoEditFile...............3
echoRemoveFile.............4
echoExitMenu...............5
readchoice
test$choice=5
do
case$choicein
1)ls;;
2)echoEntertargetdirectory
readdir
cd$dir
;;
3)echoEnterfilename
readfile
vi$file
;;
4)echoEnterfilename
readfile
rm$file
;;
q|Q|5)echoGoodbye;;
*)echoillegalOption
esac
done
更多精彩
赞助商链接