bash for loop with variable range code example
Example 1: bash for loop
#!/bin/bash
for (( c=1; c<=5; c++ ))
do
echo "Welcome $c times"
done
Example 2: bash for interval
for i in $(seq 1 $END); do echo $i; done
Example 3: bash for loop
for VARIABLE in 1 2 3 4 5 .. N
do
command1
command2
commandN
done
Example 4: bash list of integers
vals=($(seq 0 0.1 2.5))