当前位置:网站首页>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
边栏推荐
- Yunhe enmo Guoqiang, identifiez - le, saisissez - le, avant l'ébullition de la base de données nationale
- Fund valuation, expenses and accounting
- Head on Amway! Good looking and practical motor SolidWorks model material see here
- Under the epidemic, I left my job for a year, and my income increased 10 times
- Node data collection and remote flooding transmission of label information
- 收藏!这些提高程序员生产力的工具你用过吗?
- 绿树公司官方网站
- MetaQ集群安装测试
- I hope you have no regrets about the regrettable things in the University
- Leetcode 1385. Distance value between two arrays
猜你喜欢

Status acquisition and control system of on-site express cabinet

Node data collection and remote flooding transmission of label information

剑指 Offer 14- II. 剪绳子 II

M1笔记本居家办公的痛点及解决方案 | 社区征文

Wechat applet: big red festive UI guessing lantern riddles is also called guessing character riddles

2022 PMP project management examination agile knowledge points (5)

@Scheduled注解的坑,我替你踩了

sql刷题595. 大的国家

开始“收割”!钉钉调整“钉钉Teambition”免费用人数上限,超十人将无法正常用

AI赋能新零售,「智」胜之道在于生态思维|数智夜话直播精选摘录
随机推荐
云和恩墨盖国强,识别它、抓住它,在国产数据库沸腾以前
PROJECT #1 - BUFFER POOL [CMU 15-445645]笔记
正则表达式:字符(2)
Profit distribution and taxation of funds
写论文工具:LaTex在线网站
Under the epidemic, I left my job for a year, and my income increased 10 times
剑指 Offer 38. 字符串的排列
Leetcode 1385. Distance value between two arrays
Leetcode(680)——验证回文字符串 Ⅱ
自己收藏的一些网址
FPGA开发(2)——IIC通信
开始“收割”!钉钉调整“钉钉Teambition”免费用人数上限,超十人将无法正常用
Open source the Ernie tiny lightweight technology of "Wenxin big model", which is accurate and fast, with full effect
Top ten securities companies: "bulldozer market" reappearance
matlab习题 —— 程序控制流程练习
“微博评论”的高性能高可用计算架构
NRM explanation
Solr basic operation 4
sql刷题595. 大的国家
matplotlib matplotlib中plt.hist()参数解释