keyword

Bash do keyword

Starts a loop body; recognized as reserved syntax in the appropriate grammatical position.

Formal Syntax & Structure

bash syntaxbash
while condition; do commands; done

Return Value

not applicable

Starts a loop body; recognized as reserved syntax in the appropriate grammatical position.

Working Example

Example Snippetbash
for item in alpha beta gamma; do  printf '%s\n' "$item"done
Bash Reference