当前位置:网站首页>Shell operator
Shell operator
2022-06-29 23:44:00 【Xiaojing, who likes dumplings】
declare Declare variable type
declare [+/-][ Options ] Variable name
-: Set the type of comfort for the variable
+: Remove the type attribute of a variable
-i: Declare a variable as an integer (integer)
-x: Declare a variable as an environment variable
-p: Displays the declared type of the specified variable
Numerical operation
Method 1
Use declare -i
aa=11
bb=22
declare -i cc=$aa+$bb
echo $cc
33
expr or let Numerical tools
aa=22
bb=33
dd=$(expr $aa + $bb)
echo $dd
55
( ( shipment count type ) ) or (( Arithmetic expression )) or (( shipment count type )) or [ Arithmetic expression ]
aa=33
bb=44
cc=$(($aa+$bb))
echo $cc
77
边栏推荐
- Golang泛型的巧妙应用,防止变量空指针错误,防止结构体字段空指针错误
- 我想知道今天还可以开户么?另外想问,现在在线开户安全么?
- Pain points and solutions of M1 notebook home office | community essay solicitation
- 6.29日刷题题解
- Speech signal processing (II): phonation physiology, auditory physiology and auditory psychology
- Remember the process of checking online MySQL deadlock. You should not only know curd, but also know the principle of locking
- 记一次排查线上MySQL死锁过程,不能只会curd,还要知道加锁原理
- Why is JSX syntax so popular?
- Fund valuation, expenses and accounting
- Is China Merchants Securities reliable? Is it safe to open a stock account?
猜你喜欢

Sword finger offer 15 Number of 1 in binary

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

333333333333333333333333333333

正则表达式:字符(2)

这个简单的小功能,半年为我们产研团队省下213个小时

FPGA开发(2)——IIC通信

数莓派 4怎么样?可能的玩法有哪些?

Pain points and solutions of M1 notebook home office | community essay solicitation

Jetpack之Room的使用,结合Flow

Implementation of aut, a self-developed transport layer protocol for sound network -- dev for dev column
随机推荐
High performance and high availability computing architecture of "Weibo comments"
RRDtool 画MRTG Log数据
AI赋能新零售,「智」胜之道在于生态思维|数智夜话直播精选摘录
Pain points and solutions of M1 notebook home office | community essay solicitation
Some of my favorite websites
@Scheduled annotation pit, I stepped on it for you
除子
Xutils3 transfer set
关于 Apache 的 25 个初中级面试题
Yunhe enmo Guoqiang, identifiez - le, saisissez - le, avant l'ébullition de la base de données nationale
Cacti最大监控数测试
matplotlib matplotlib可视化之柱状图plt.bar()
大厂试水 HPE推出Arm CPU通用服务器产品
机器学习:VC维的概念和用途
基金的利润分配与税收
提供有效的绩效评估
剑指 Offer 14- I. 剪绳子
Applet plug-in access, development and precautions
Gracefully transform the SMS business module and start the strategic mode!
What is online account opening? In addition, is it safe to open a mobile account?