#1/bin/bash if [ $# -eq 1 ]; then counter="1" counter1="1" echo "for loop:" for i in $(seq 1 $1); do echo $i done for i in $(seq 1 3 20); do echo "welcome $i times" done for((i=1;i<3;i++)); do echo $i done echo "while loop" while [ $counter -le $1 ]; do echo $counter counter=$((counter+1)) done echo "until loop:" until [ $counter1 -gt $1 ]; do echo $counter1 counter1=$((counter1+1)) done else echo "error" fi