当前位置:网站首页>shell-运算符
shell-运算符
2022-06-29 23:34:00 【爱吃水饺的小京】
declare声明变量类型
declare [+/-][选项]变量名
-:给变量设定类型舒心
+:取消变量的类型属性
-i:将变量声明为整数型(integer)
-x:将变量声明为环境变量
-p:显示指定变量的被声明类型
数值运算
方法1
使用declare -i
aa=11
bb=22
declare -i cc=$aa+$bb
echo $cc
33
expr或let数值运算工具
aa=22
bb=33
dd=$(expr $aa + $bb)
echo $dd
55
( ( 运 算 式 ) ) 或 ((运算式)) 或 ((运算式))或[运算式]
aa=33
bb=44
cc=$(($aa+$bb))
echo $cc
77
边栏推荐
- label问题排查:打不开标注好的图像
- 采购数智化爆发在即,支出宝“3+2“体系助力企业打造核心竞争优势
- MetaQ集群安装测试
- NRM explanation
- Gracefully transform the SMS business module and start the strategic mode!
- Halcon实用:焊点检出设计思路
- 记一次排查线上MySQL死锁过程,不能只会curd,还要知道加锁原理
- C pointer advanced 1-- > character pointer, array pointer, pointer and array parameter transfer, function pointer
- InfluxDB时序数据库系统
- Software testing interface testing postman testing tool interface testing process execution interface testing interface associated environment variables and global variables built-in dynamic parameter
猜你喜欢

剑指 Offer 14- II. 剪绳子 II

收藏!这些提高程序员生产力的工具你用过吗?

Software testing interface testing JMeter 5.5 installation tutorial

正则表达式:字符(2)

语音信号处理(二): 发声生理、听觉生理与听觉心理

SQL question brushing 595 Big country

Leetcode 1385. 两个数组间的距离值

matplotlib matplotlib中plt.hist()参数解释

Under the epidemic, I left my job for a year, and my income increased 10 times

记一次排查线上MySQL死锁过程,不能只会curd,还要知道加锁原理
随机推荐
软件测试 接口测试 Postman测试工具 接口测试的流程 执行接口测试 接口关联 环境变量和全局变量 内置动态参数以及自动有的动态参数
High performance and high availability computing architecture of "microblog comments" in microblog system
High performance and high availability computing architecture of "Weibo comments"
AI赋能新零售,「智」胜之道在于生态思维|数智夜话直播精选摘录
穿越过后,她说多元宇宙真的存在
绿树公司官方网站
LC:有效的数独 + 旋转图像
Matplotlib histogram of Matplotlib visualization plt bar()
Solr基础操作1
【一起上水硕系列】Day 8
Intranet penetration (NC)
小程序插件接入、开发与注意事项
成为唯一的key
Start harvesting! Nailing: adjust the maximum number of free users of "nailing team". If the number exceeds 10, it will not work normally
手机开户一般哪个证券公司好?另外,手机开户安全么?
Effective self summary of remote communication | community essay solicitation
Cacti最大监控数测试
LC: maximum subarray and
[译]在软件开发行业工作 6 年后,那些年我曾改过的观念
优雅的改造短信业务模块,策略模式走起!