shell编程- 键盘输入变量
2016-07-01 19:20
267 查看
shell中通过键盘输入变量read参数
#!/bin/shecho "please input a word:"read strecho $strread 用法:
参数 | 用途 | 例子 |
---|---|---|
-p | 提示作用 | read -p "please input:" var |
-n | 统计输入的数量。自动结束 | read -n 2: var |
-t | 设置输入时间(时间内未输入自动结束) | read -t 5: var |
-s | 关闭显示(用于输入密码不可见) | read -s: var |
相关文章推荐
- shell IFS例子
- hdfs shell命令及java客户端编写
- shell输入显示带颜色字体的模块脚本
- xshell远程终端实用设置
- Shell编程笔记-语法示例
- Jmeter之Bean shell使用
- Content Shell Apk分析之概述
- xshell 操作方法
- shell脚本----if判断条件
- 由一段shell脚本想到的知识
- 自动安装LNMP的简洁Shell脚本
- PowerShell 自动化管理 AWS(4)- VPC
- PowerShell 自动化管理 AWS(4)- VPC
- UNIX & Linux Shell Scripting Tutorial - If/Else
- VitualBox虚拟机安装CentOS, shell模式与图形化界面的相互切换
- ansible学习记录
- scp 传文件出现"-bash: scp: command not found "的解决办法
- 记linux shell的两个小技巧:shell数组和字符串判断
- shell变量和函数定义
- 这里是shell命令的总结Linux和Unix通用