read的使用 (ex36.sh)
来源:互联网 发布:手机怎样升级4g网络 编辑:程序博客网 时间:2024/06/14 18:29
#!/bin/bash# "Reading" variables.echo -n "Enter the value of variable 'var1': "# The -n option to echo suppresses newline.read var1# Note no '$' in front of var1, since it is being set.echo "var1 = $var1"echo# A single 'read' statement can set multiple variables.echo -n "Enter the values of variables 'var2' and 'var3' "echo =n "(separated by a space or tab): "read var2 var3echo "var2 = $var2 var3 = $var3"# If you input only one value,#+ the other variable(s) will remain unset (null).exit 0
[root@localhost shell]# ./ex36.sh
Enter the value of variable 'var1': 22
var1 = 22
Enter the values of variables 'var2' and 'var3' =n (separated by a space or tab):
22 33
var2 = 22 var3 = 33
- read的使用 (ex36.sh)
- 笨办法学python的笔记之六(ex36 设计和调试)
- Zookeeper命令行zkCli.sh&zkServer.sh的使用(四)
- 脚本参数的使用(ex17.sh)
- declare的使用 (ex20.sh)
- set的使用 (ex34.sh)
- linux 下 sh 的使用
- read命令的使用
- read的使用
- read me of del.sh
- shell中random的使用 (ex21.sh)
- shell中for循环的使用 (ex22.sh)
- shell中until的使用 (ex27.sh)
- basename和dirname的使用 (ex35.sh)
- pushd和popd的使用(ex37.sh)
- linux脚本-let的使用(ex46.sh)
- shell脚本--printf的使用(ex47.sh)
- shell中while的使用 (ex26.sh,ex26a.sh)
- 堆栈和变量的分配区域
- Cocos2d-x初入学堂(11)-->CCScene场景切换
- 常规及内联函数调用过程详解
- 在js的正则式中重复使用时遇到的问题
- Android makefile 组织结构
- read的使用 (ex36.sh)
- Android硬件抽象层(HAL)概要介绍和学习计划
- sqlite3 回调函数
- STL--map
- 过去的记忆,已经无动于衷:QQ空间伤感日志
- Healthrageous:个性化数据帮用户控制病情并降低费用
- HttpServletResponse的应用
- Android Building System 总结
- JSON数据解析