unix shell script for loop code example
Example 1: for loop in shell script
for i in {1..5}
do
echo "Welcome $i times"
done
Example 2: shell script for loop example
#!/bin/sh
for i in 1 2 3 4 5
do
echo "Looping ... number $i"
done
for i in {1..5}
do
echo "Welcome $i times"
done
#!/bin/sh
for i in 1 2 3 4 5
do
echo "Looping ... number $i"
done