当前位置:网站首页>Basic shell operations (Part 2)
Basic shell operations (Part 2)
2022-07-29 08:24:00 【Crying dogs in the sun】
Catalog
Operator
Arithmetic operator
- expr + , - , *, /, % Add , reduce , ride , except , Remainder

Compound operation , Be careful `` Not single quotes
- “ ( ( shipment count type ) ) ” or “ (( Arithmetic expression ))” or “ (( shipment count type ))” or “[ Arithmetic expression ]”

String operators
- = Checks if two strings are equal , Relative return true
- != Detect whether two strings are not equal , Unequal return true
- -z Check if the string length is 0, by 0 return true
- -n Check whether the string length is not 0, Not for 0 return true
- $ Check if the string is empty , Not empty return true
In the process control meeting
Process control
if else Judge
grammar :
if [ Conditional judgment ]
then
command
fi
===============================
if [ Conditional judgment ]
then
command
else
command
fi
==============================
if [ Conditional judgment ]
then
command
elif [ Conditional judgment ]
then
command
else
command
fi
Be careful Space , stay if And after [] Spaces should be added in 
You can also write it as a sentence and add ; Such as if [ a=b ];then echoxxxxxxx;xxx;xxx;
case sentence
Every case The branch begins with a right parenthesis , Use two semicolons ;; Express break, End with esac Express
case $ Variable name in
" value 1")
If the value of the variable is equal to the value 1, Then execute the procedure 1
;;
" value 2")
If the value of the variable is equal to the value 2, Then execute the procedure 2
;;
… Omit other branches …
*)
If none of the values of the variables are above , Then execute this procedure
;;
esac


for loop
And in other languages for The cycle is similar
for Variable in item1 item2 ... itemN
do
command
.....
done
==========================
for (( expression ))
do
command
.....
done

while loop
while [ Conditional judgment ]
do
command
done
====================
while (( expression ))
do
command
done

function
Function name (){
The body of the function
[return]
}
No addition return Will return the last sentence 
边栏推荐
- Component transfer participation lifecycle
- [noi simulation] computational geometry (convex hull, violence, and search set)
- Product promotion channels and strategies, cosmetics brand promotion methods and steps
- [academic related] why can't many domestic scholars' AI papers be reproduced?
- Week 1 task deep learning and pytorch Foundation
- leetcode hot 100(刷题篇9)(301/45/517/407/offer62/MST08.14/)
- Huawei wireless device configuration uses WDS technology to deploy WLAN services
- 谷歌浏览器免跨域配置
- node:文件写入数据(readFile、writeFile),覆盖与增量两种模式
- (Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
猜你喜欢

Simplefoc parameter adjustment 2- speed and position control

BiSeNet v2

pnpm install出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies

Chrony time synchronization

Hc-sr04 use method and routine of ultrasonic ranging module (STM32)

What constitutes the smart charging pile system?

Simplefoc parameter adjustment 1-torque control

亚马逊测评自养号是什么,卖家应该怎么做?

Back up Google or other browser plug-ins

Tensorboard use
随机推荐
Windows 安装 MySQL 5.7详细步骤
Unity shader learning (VI) achieving radar scanning effect
Inclination sensor accuracy calibration test
Simplefoc parameter adjustment 3-pid parameter setting strategy
Alibaba political commissar system - Chapter 4: political commissars are built on companies
产品推广的渠道和策略,化妆品品牌推广方法及步骤
Deep learning (1): prediction of bank customer loss
Noise monitoring and sensing system
(Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
Charging pile charging technology new energy charging pile development
Proteus simulation based on 51 MCU ADC0808
Hal library learning notes - 8 concept of serial communication
Txt plain text operation
torch.Tensor.to的用法
Solve the problem of MSVC2017 compiler with yellow exclamation mark in kits component of QT
Clion+opencv+aruco+cmake configuration
sql判断语句的编写
commonjs导入导出与ES6 Modules导入导出简单介绍及使用
Reading papers on false news detection (4): a novel self-learning semi supervised deep learning network to detect fake news on
Second week of postgraduate freshman training: convolutional neural network foundation