专业的编程技术博客社区

网站首页 > 博客文章 正文

shell中所有循环语法(shell怎么写循环)

baijin 2024-09-04 02:13:51 博客文章 6 ℃ 0 评论
for i in $(ls)
do 
	echo $i 
done

while循环

#!/bin/bash 
counter=0
while [$counter -lt 10]
do
	echo $counter
	let counter=counter+1
done

until循环

#!/bin/bash 
counter=20
until [$counter -lt 10]
do 
	echo $counter
	let counter -=1
done


Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表