Linux shell programming example -- a simple directory menu

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

Enterprise-level combat of Shell programming for Linux operation and maintenance

Introduction to Linux Basics and Practice of Enterprise Application Deployment

Getting started with Linux

Guess you like

Origin blog.csdn.net/m0_37449634/article/details/131452376