当前位置:网站首页>Process control
Process control
2022-07-22 21:26:00 【Ten at eight】
—case sentence
Multiple branches case Conditional statements
case Statement and if...elif...else Statements are also multi branch conditional statements , But and if The difference between multi branch conditional statements is that ,case Statement can only judge one kind of conditional relation , and if Statement can judge a variety of conditional relations .
Format :
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 .....
*)
If none of the variables is the above value , Then execute this procedure
;;
esac
—for loop
Grammar 1 :
for Variable in value 1 value 2 value 3....
do
Execution procedure
done
Grammar II :
for (( Initial value ; Cycle control conditions ; Variable change ))
do
Program
done
—while Circulation and until loop
1、while loop
while A cycle is an indefinite cycle , Also known as conditional loops . As long as the conditional judgment holds , The cycle goes on and on , Until the conditional judgment doesn't hold , The cycle stops . This is the sum of for The fixed loop is not the same .
Format :
whie [ Conditional judgment ]
do
Program
done
2、until loop
until loop , and while The cycle is reversed ,until As long as the conditional judgment does not hold, the loop will be carried out , And execute the loop program . Once the cyclic condition is established , Then stop the cycle .
Format :
until [ Conditional judgment ]
do
Program
done
边栏推荐
- Write a 3D banner using JS
- How to do research and development lean demand management well
- JUC-8.0-Future和Callable
- 使用简单的js实现圆弧布局
- Using simple JS to realize arc layout
- Simple sentences -one
- Pytorch自动求导
- Bash变量--环境变量
- Juc-7.1 thread collaboration semaphore
- Buuctf breakthrough diary 04 -- [strong net cup 2019] casual note 1
猜你喜欢
随机推荐
Buuctf breakthrough diary --[mrctf2020]ez_ bypass1
Simple sentences -one
Chapter 2: Minio stand-alone version, using the client to back up files
BUUCTF闯关日记03--[极客大挑战 2019]Havefun1
JUC-6.2-并发容器-CopyOnWriteArrayList
Solve the problems that tracepass website cannot be opened and stackoverflow is not fully displayed
Juc-6.3-concurrency container queue
LeetCode笔记(一)回溯
[lttng learning journey] - simply add a trace point to the user program
[lttng learning journey] - trace control -- advanced
(6) Vulhub column: apereo CAS 4.x deserialization vulnerability
New cover of time: metauniverse will change everything
Pytorch自动求导
[lttng learning journey] - lttng features
Buuctf entry diary -- [mrctf2020] how about you (super detailed)
BUUCTF闯关日记--[MRCTF2020]你传你呢(超详解)
BUUCTF闖關日記--[網鼎杯 2020 青龍組]AreUSerialz
Juc-8.0-future and callable
Chapter 1: Minio introduction and installation
浅谈 filter伪协议的特性