Shell: May 2010 Archives

BASH for loop

user-pic
Vote 0 Votes

# Output 1 2 3...99
for i in {1..99}
do
   echo $i
done

for ((i=1;i<=99;i++))
do
   echo $i
done

for i in `seq 1 99`
do
   echo $i
done

# Output 1 3 5...99
for i in `seq 1 2 99`
do
   echo $i
done

# Output a to z
for i in {a..z}
do
   echo $i
done

About this Archive

This page is an archive of entries in the Shell category from May 2010.

Shell: March 2010 is the previous archive.

Shell: October 2010 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives