shell script简单范例
来源:互联网 发布:最优化 中科院 编辑:程序博客网 时间:2024/04/26 14:07
1、对谈试,变量的内容取自标准输入(read)
read -p "Please input your first name:" firstname #屏幕输入,并将输入的值赋予firstname变量
read -p "Please input your last name:" lastname #屏幕输入,并将输入的值赋予lastname变量
echo -e "Your full name is : $firstname $lastname" #屏幕输出
2、数值运算
read -p "Please input your first num:" firstnum #屏幕输入,并将输入的值赋予firstnum变量
read -p "Please input your last num:" lastnum #屏幕输入,并将输入的值赋予lastnum变量
total=$(($firstnum * $lastnum))
echo -e "两者相乘,所得为$total" #屏幕输出
0 0
- shell script简单范例
- shell script范例
- 第十三章 简单的 shell script 练习
- shell范例
- shell范例
- shell Script
- shell script
- Shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- shell script
- Shell Script
- shell script
- 阿里巴巴笔试题求最小三元组距离
- C#的Http请求
- 关于编程学习的好网站
- c++获取系统信息(操作系统,cpu,内存,ip,mac)
- const浅析
- shell script简单范例
- iOS判断NSString 只含有数字
- 获取月份天数
- CSU 1552: Friends(素数测试+二分匹配)
- ThreadLocal
- 移动平台的meta标签-----神奇的功效
- Discuz X3.1微信打通版,发布回复时出现提示:您的请求来路不正确或表单验证串不符,无法提交问题的解决
- Android系统自带录屏(动态截屏)功能
- Apache运行机制剖析