DEV Community

Eduardo Issao Ito
Eduardo Issao Ito

Posted on

 

Bash: loops

Different loop styles in bash:

for i in $( ls )
do
    echo $i
done
for i in $( seq 1 10 )
do
    echo $i
done
for ((i = 0 ; i < max ; i++ ))
do
    echo $i
done
i=0
while [ $i -lt 10 ]
do
    echo $i
    i=$((i+1))
done
i=20
until [ $i -lt 10 ]
do
    echo $i
    i=$((i-1))
done

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git