What it does: Keeps running while a condition is true. Great for reading files line-by-line or polling commands until a state changes.
What is it? while
repeats a block as long as a condition is true—great for reading files or polling a command.
#!/bin/bash
FILE="names.txt"
while IFS= read -r line; do
echo "Name: $line"
done < "$FILE"