do
echo $var
done
这样也是可以的,没错。
想回退的话用 ctrl+backspace
新建一个test.sh文件#!/bin/shecho "1 : For Test"echo "2 : For nohup &" while true do echo -n "please enter the number:" read line echo "$line" if [[ $line = "1" ]]then echo "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:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)