General While loop
while command
do
Statement(s) to be executed if command is true
done
#!/bin/sh
a=0
while [ $a -lt 10 ]
do
echo $a
a=`expr $a + 1`
done
While loop single liner
while true; do foo; sleep 2; done
while command
do
Statement(s) to be executed if command is true
done
#!/bin/sh
a=0
while [ $a -lt 10 ]
do
echo $a
a=`expr $a + 1`
done
While loop single liner
while true; do foo; sleep 2; done
Comments