To give you the best experience, this site uses cookies. Continuing to use 9bis.net means you agree to our use of cookies.
 

 

while ... do ... done ( fr )

Dernière modification : 2013/01/26 19:17

The first loop syntax is the while loop.
while [ expr ]
do
      command
done

While the expr is true the command is executed.
msh> n=1 ; i=1
msh> while [ $i -le 10 ] ; do
    1> (( n = $n * $i ))
    1> (( i++ ))
    1> done
msh> print $n
3.6288e+006