continue
: Skips the rest of the current loop iteration and proceeds with the next iteration.break
: Exits the loop immediately.
Here are examples demonstrating the use of continue
and break
in each type of loop:
#!/bin/bash
for file in "$PWD"/*