builtin

Bash continue

Resumes the next iteration of the nth enclosing loop; default one. Use a positive integer.

Formal Syntax & Structure

bash syntaxbash
continue [n]

Parameters & Attributes

NameTypeDescription
nintegerEnclosing loop to resume.

Return Value

exit status

Resumes the next iteration of the nth enclosing loop; default one. Use a positive integer.

Working Example

Example Snippetbash
for row in A B; do  for col in 1 2 3; do    if [[ $col == 2 ]]; then continue 2; fi    printf '%s%s\n' "$row" "$col"  donedone
Bash Reference