满意答案
mzvbu
2017.11.09
采纳率:46% 等级:12
已帮助:8135人
新建一个test.sh文件
#!/bin/shecho "1 : For Test"echo "2 : For nohup &" while truedoecho -n "please enter the number:"read lineecho "$line"if [[ $line = "1" ]];thenecho "For Test"elif [[ $line = "2" ]];then echo "For nohup &"else echo "can not find command"fidone
运行测试日志如下:
[root@master batch]# sh test.sh1 : For Test2 : For nohup &please enter the number:11For Testplease enter the number:22For nohup &please enter the number:33can not find commandplease enter the number:sssscan not find commandplease enter the number:
00分享举报