Bash for loop
Source https://linuxize.com/post/bash-for-loop/
for loop for item in [LIST] do [COMMANDS] done loop overstrings for element in Hydrogen Helium Lithium Beryllium do echo "Element: $element" done loop over a number range for i in {0..3} do echo "Number: $i" done loop over number range and increment by 5 for i in {0..20..5} do echo "Number: $i" done loop over array elements BOOKS=('In Search of Lost Time' 'Don Quixote' 'Ulysses' 'The Great Gatsby') for book in "${BOOKS[@]}"; do echo "Book: $book" done The C-style Bash for loop for ((i = 0 ; i <= 1000 ; i++)); do echo "Counter: $i" done break and continue Statements for element in Hydrogen Helium Lithium Beryllium; do if [[ "$element" == 'Lithium' ]]; then break fi echo "Element: $element" done echo 'All Done!