Usually crazy homework

Usually crazy homework (1)
Insert picture description here

Please realize the loop judgment if you encounter 3 skip and print out numbers below 8

  1 #!/bin/bash
  2 count=0
  3 while [ $count -lt 8 ]
  4 do
  5     if [ $count -eq 3 ];then
  6         let count++
  7         echo $count
  8         continue
  9     fi
 10     echo "======="
 11     echo $count 
 12     let count++ #let+=2
 13     echo "======"
 14 done

在这里插入代码片

Achieve effect

在这里插入代[root@web01 ~]# . e.sh
=======
0
======
=======
1
======
=======
2
======
4
=======
4
======
=======
5
======
=======
6
======
=======
7
======
码片
总结以下,发现3没有打印出来,4出现了两次。

Guess you like

Origin blog.csdn.net/ximanxue/article/details/112805282