#/usr/bin/sh
############################################################
#此处使用cat 进行多行显示,如果单行的话就使用echo,定义时函数格式 menu(){},调用时直接menu
############################################################
menu(){
cat<<END
1.[INSTALL LAMP]
2.[Install lnmp]
3.[Install nfs ]
4.[Install rsync]
Please input the num that you want
END
}
menu
read -p "Input a num:" a
echo "You select $a"
case $a in
1)echo "starting install lamp"
;;
2)echo "starting install lnmp"
;;
3)echo "starting install nfs"
;;
4) echo "starting install rsync"
;;
default) echo "your input is invalid ,input again"
;;
esac
运行结果: