Bash for Loop
A for loop runs the same commands once for each item in a list.
The loop body goes between do and done. You can also count with the C-style form for ((i=1; i<=3; i++)).
Loop over a list
for fruit in apple banana cherry; do echo "I like $fruit"; done
I like apple
I like banana
I like cherry
Count with a number
Save this as count.sh:
#!/bin/bash
for ((i=1; i<=3; i++)); do
echo "Number $i"
done
Run it:
./count.sh
Number 1
Number 2
Number 3