当前位置:网站首页>shell脚本循环语句
shell脚本循环语句
2022-08-03 04:36:00 【1701y】
循环语句
for循环语句
读取不同的变量值,用来逐个执行同一组命令
for语句的结构
格式:
for 变量名 in 取值列表
do
命令序列
done


花括号{}和seq在for循环的应用:
for i in {1…50…2} 1-50的奇数
for i in {2…50…2} 1-50的偶数
for i in {10…1} 1-10倒序排列
for i in $(seq 10) 1-10正序排列
for i in $(seq 10 -1 1) 1-10倒序排列
for i in $(seq 1 2 10) 1-10的奇数,中间为步长
for i in $(seq 0 2 10) 1-10的偶数,中间为步长

写出1到10中的奇数


计算1到10的奇数和


根据文本查看



根据段查看


猜数字小游戏

边栏推荐
- Interface test practice | Detailed explanation of the difference between GET / POST requests
- Interface testing framework of actual combat (2) | interface request assertion
- 三丁基-巯基膦烷「tBuBrettPhos Pd(allyl)」OTf),1798782-17-8
- How many moments have you experienced the collapse of electronic engineers?
- 2.何为张量
- 工程水文学试题库
- SM30 表维护视图数据保存前 数据校验事件
- Shell编程的条件语句
- 【翻译】开发与生产中的Kubernetes修复成本对比
- 链动2+1模式简单,奖励结构丰厚,自主裂变?
猜你喜欢

Shell之条件语句

Bubble sort in c language structure

荧光标记多肽FITC/AMC/FAM/Rhodamine/TAMRA/Cy3/Cy5/Cy7-Peptide

社交电商:流量红利已尽,裂变营销是最低成本的获客之道

Dialog manager in the fourth chapter: the dialog message loop

GIS数据漫谈(五)— 地理坐标系统

数字孪生园区场景中的坐标知识

Shenzhen Offline Registration|StarRocks on AWS: How to conduct rapid and unified analysis of real-time data warehouses

【Harmony OS】【FAQ】Hongmeng Questions Collection 1

RequestContextHolder
随机推荐
工程制图-齿轮
2022河南萌新联赛第(四)场:郑州轻工业大学 G - 迷宫
13.机器学习基础:数据预处理与特征工程
Practical application of WebSocket
v-on指令:为元素绑定事件
flink sql任务变更,在sql里面增加几个字段后,从以前保存的savepoint恢复启动出错。
【Harmony OS】【FAQ】Hongmeng Questions Collection 1
7.Keras开发简介
EssilorLuxottica借助Boomi的智能集成平台实现订单处理的现代化
[Developers must see] [push kit] Collection of typical problems of push service service 2
接口测试框架实战(三)| JSON 请求与响应断言
Problems that need to be solved for interrupting the system
Flink状态
数字化时代,企业如何建立自身的云平台与商业模式的选择?
工程水文学知识点
excerpt from compilation book
CyberArk被评为2022年Gartner特权访问管理魔力象限领导者
【uni-APP搭建项目】
Technology Sharing | How to do assertion verification for xml format in interface automation testing?
Shell编程的条件语句