当前位置:网站首页>Bash variables - numeric operations and operators
Bash variables - numeric operations and operators
2022-07-22 21:26:00 【Ten at eight】
1、declare Declare variable type
#declare [+_] [ Options ] Variable name
- ---- Set type properties to variables
+ ----- 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
2、 Numerical operation --- Method 1
#aa=11
#bb=22
#declare -i cc=$aa+$bb
#echo $cc
Method 2:expr or let Numerical tools
#aa=11
#bb=22
#dd=$(expr $aa + $bb) ---------- Be careful + There must be spaces on the left and right sides
Method 3:$(( Arithmetic expression )) or $[ Arithmetic expression ]
#aa=11
#bb=22
#ff=$(($aa+$bb))
#echo $ff
You can do logical operations && ||.
边栏推荐
- Bishett route - hyperspectral image classification with deep learning in pytorch environment
- [lttng practice] - design a set of things to monitor the execution time and cycle of user programs running in a certain cycle -- demand analysis and scheme design
- Realize news page paging
- Chapter 1: Minio introduction and installation
- RPM package management - Yum online management - IP address configuration and network Yum source
- Software package management RPM package management checksum file extraction
- BUUCTF闯关日记03--[极客大挑战 2019]Havefun1
- RPM package management - Yum online management - Yum command
- BUUCTF闯关日记02--[HCTF 2018]WarmUp1
- BUUCTF闯关日记04--[ACTF2020 新生赛]Include1
猜你喜欢
BUUCTF闯关日记04--[强网杯 2019]随便注1
Write a 3D banner using JS
Buuctf entry diary -- [nctf2019]fake XML Cookbook
[pytorch deep learning practice] learning notes section 4 back propagation
[lttng learning journey] ----- components of lttng deconstruction
[lttng learning journey] ----- core concepts
Chapter 2: configure data sources, redis, security, swagger and other tools jar for the project
第二章:给项目配置数据源,redis,security,swagger等工具jar
[LTTng学习之旅]------Trace控制--进阶
Chapter 8: custom exception return
随机推荐
流程控制—if语句
(七)vulhub专栏:Log4j远程代码执行漏洞复现
[lttng learning journey] - trace control - Preliminary
关于二分法
2020中南大学信息与通信夏令营面试
Double pointer in linked list -- fast and slow pointer
[LTTng实操]------设计一套东西监控某周期运行用户程序的执行时间和周期--需求分析和方案设计
Bash基本功能—通配符和其他特殊符号
Set colSpan invalidation for TD of table
YOLO9000: Better, Faster, Stronger
Juc-7.1 thread collaboration semaphore
Realize news page paging
第八章:自定义异常返回
Buuctf breakthrough diary --[mrctf2020]ezpop1
Juc-7.0-thread collaboration countdownlatch
5.网络和安全
JS BOM(浏览器对象模型)
Simple sentences -one
[LTTng学习之旅]------环境搭建
[lttng learning journey] - simply add a trace point to the user program