December 2018
Beginner
452 pages
12h 17m
English
As with most things in Bash (and life), there is a Yang to the Yin that is break: the continue keyword. If you use continue, you're telling the loop to stop the current loop, but continue with the next run. So, instead of stopping the entire loop, you'll just stop the current iteration. Let's see if another example can make this clear:
reader@ubuntu:~/scripts/chapter_11$ vim for-continue.shreader@ubuntu:~/scripts/chapter_11$ cat for-continue.sh #!/bin/bash###################################### Author: Sebastiaan Tammer# Version: v1.0.0# Date: 2018-10-28# Description: For syntax with a continue.# Usage: ./for-continue.sh###################################### Look at numbers 1-20, in steps of 2.for number in {1..20..2}; ...