for on bash code example
Example 1: bash for loop
#!/bin/bash
for (( c=1; c<=5; c++ ))
do
echo "Welcome $c times"
done
Example 2: for in bash
for i in {0..100..10}
do
echo $i
done
will print #0 10 20 30 40 ...100
#!/bin/bash
for (( c=1; c<=5; c++ ))
do
echo "Welcome $c times"
done
for i in {0..100..10}
do
echo $i
done
will print #0 10 20 30 40 ...100