cat name.txt | while read A
do
if [ $A -ne 5 ]
then
echo $A
else
echo 我要跳过
continue
fi
done
jrhmpt01:/root# sh ./a1.sh
1
2
3
4
我要跳过
6
7
8
9
10
shell 中的continue
最新推荐文章于 2024-05-23 18:44:14 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
cat name.txt | while read A
do
if [ $A -ne 5 ]
then
echo $A
else
echo 我要跳过
continue
fi
done
jrhmpt01:/root# sh ./a1.sh
1
2
3
4
我要跳过
6
7
8
9
10