Linux shell脚本读取用户输入的参数
来源:互联网 发布:数据库服务器cpu 要求 编辑:程序博客网 时间:2024/05/22 04:51
新建一个test.sh文件
- #!/bin/sh
- echo "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"
- fi
- done
运行测试日志如下:
- [root@master batch]# sh test.sh
- 1 : For Test
- 2 : For nohup &
- please enter the number:1
- 1
- For Test
- please enter the number:2
- 2
- For nohup &
- please enter the number:3
- 3
- can not find command
- please enter the number:ss
- ss
- can not find command
- please enter the number:
阅读全文
0 0
- linux shell脚本读取用户输入的参数
- linux shell脚本读取用户输入的参数
- Linux shell脚本读取用户输入的参数
- linux shell读取用户输入
- Linux Shell 读取用户输入
- shell 脚本中关于用户输入参数的处理
- Shell读取用户输入
- shell 读取用户输入
- Shell读取用户输入
- shell脚本读取终端输入的方法
- shell脚本之从用户读取输入并进行验证
- shell脚本中用getopts处理用户输入选项和参数
- shell 脚本编程学习(二) 变量,用户输入,参数
- Linux学习-shell脚本编程基础之处理用户输入
- Linux命令行与shell脚本(10)--获得用户输入
- shell 脚本 输入参数 学习
- SHELL脚本的基础知识4——处理用户输入
- SHELL脚本的基础知识4——处理用户输入
- ssh keys管理工具
- MenuItemFont字体设置bug的解决方法
- java-captcha实现验证码
- leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal
- 搭建开发山寨币交易平台过程中用得到区块链签名认证技术
- Linux shell脚本读取用户输入的参数
- 面向对象程序设计上机练习三(有默认参数的函数)
- angular+一个简单的页面+有上角有主页+关于我们+联系我们
- LeetCode.154 Find Minimum in Rotated Sorted Array II
- 根据相同的class名获取所有的节点
- 第一章 深入浅出Web请求过程(笔记)
- mybatis查询出来的字段的值为null,驼峰字段
- sql语句的各种模糊查询
- Android开发,ZxMvp框架的引入及使用详解(上)