当前位置:网站首页>Ji Geng 44 / 90
Ji Geng 44 / 90
2022-04-21 15:38:00 【Programming Capriccio】
Random thoughts on programming
Bash loop
while
while condition; do
commands
done
until
until Circulation and while The cycle is just the opposite , As long as it doesn't meet the judgment criteria ( Conditions fail to judge ), And then we cycle through the specified statement . Once the judgment conditions are met , Just exit the loop .
until condition; do
commands
done
for...in
for variable in list
do
commands
done
for
for (( expression1; expression2; expression3 )); do
commands
done
// In the above code ,expression1 Used to initialize loop conditions ,expression2 The condition used to determine the end of the loop ,expression3 Execute at the end of each iteration of the loop , Used to update values .
select
select name
[in list]
do
commands
done
Bash Would be right select Do the following in turn .
1.select Create a menu , The content is a list list Each of , And each item is preceded by a number .
2.Bash Prompt the user to select an item , Enter its number .
3. After user input ,Bash The content of this item will be stored in a variable name, The item number is stored in the environment variable REPLY. If the user doesn't type , Just press enter ,Bash Will re output the menu , Let users choose .
4. Executive command body commands.
5. After execution , Back to step one , Repeat the process .
eg:
select brand in Samsung Sony iphone symphony Walton
do
echo "You have chosen $brand"
done
$ ./select.sh
1) Samsung
2) Sony
3) iphone
4) symphony
5) Walton
#?
Python if sentence
if condition:
...
elif condition:
...
else:
...
版权声明
本文为[Programming Capriccio]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211536067910.html
边栏推荐
- 小白学习MySQL - 不同版本创建用户的些许区别
- 左程云 - 大厂刷题班 - 摆砖块
- JUC learning record
- Introduction to openlayers (II)
- IT服务管理框架要怎么落地?看这篇就够了
- abaqus 根据坐标施加载荷- Analytical Field 载荷映射
- Smart Park Digital financing - Digital enabling operation management platform solution
- How to synchronize client email to webmail and how to register email address?
- LeetCode 1539、第 k 个缺失的正整数
- 季更47/90
猜你喜欢

解决I.MX6U驱动移植LED闪烁
![[unity note] l2unity shader Foundation](/img/c0/6f977e8bfe3e31b1bb3a61bfa02861.png)
[unity note] l2unity shader Foundation

Hand in hand to teach you to realize hand-painted style graphics

68页智慧管廊项目建设解决方案

LeetCode刷题之652寻找重复的子树

JUC learning record

嵌入式驱动模块的加载与卸载

mysql数据库字段上下移动

Huawei power PON distribution network solution
![[advanced C language] user defined type: struct, bit segment, enumeration, union](/img/c5/4f2756aaa642a17c322ea480987041.png)
[advanced C language] user defined type: struct, bit segment, enumeration, union
随机推荐
LeetCode-232-用栈实现队列
Embedded development: three skills of reusing development board for testing
sed命令
mysql数据库字段上下移动
Page 92 group informatization planning scheme enterprise application integration solution
C语言进阶第44式:函数参数的秘密(上)
LeetCode 733、图像渲染
In the SSM project, the test method has been running in circles without stopping
注册登录程序1
[unity note] l3unity shader learning begins
Huawei power PON distribution network solution
季更56/90
MySQL通过Binlog恢复数据
shell 知:awk
LeetCode 21、合并两个有序链表
(计数线段树)lintcode中等248 · 统计比给定整数小的数的个数
49页石油石化行业信息化规划与数字化转型
Deltix Round, Summer 2021 E. Equilibrium
Hanoi tower game and recursion
事务的隔离级别详解