-break shell script it, continue
break
It represents a cycle out of this layer, break n
represented by the number of layers out of the loop. continue
Means skip the current cycle, continue n
means skip n
cycles.
example
#!/bin/bash
#文件名:test.sh
for i in 1 2 3 4 5 6 7 8 9
do
if [ $i -eq 4 ];then
continue
else
echo $i
fi
if [ $i -eq 6 ];then
break
fi
done
The output is:
ubuntu@ubuntu:~$ ./test.sh
1
2
3
5
6
ubuntu@ubuntu:~$