You are here

Loops

for list

for file in *
do
  echo $file
done

Loops with counters

for i in {1..10} 
do 
  echo $i 
done

 

for i in {1..10..2}
do
  echo $i
done

C like for loop

for ((i=0; i<5; i++))
do
  echo $i
done