for i in 1 2 3 4 5
do
echo "Welcome $i times"
done
# bash version 3.0+
for i in {1..5}
do
echo "Welcome $i times"
done
# bash version 4.0+
echo "Bash version ${BASH_VERSION}..."
for i in {0..10..2}
do
echo "Welcome $i times"
done
for (( c=1; c<=5; c++ ))
do
echo "Welcome $c times"
done
参考: