[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Difference between for and while loop



+-------------------------------
| let C=1
| for X in  a b c d e ; do
|   echo "$C: $X"
|   let C=$C+1
| done
+-------------------------------

"for" is working on a list of arguments (here: a b c d e) while

+-------------------------------
| let C=1
| while [ $C -lt 10 ] ; do
|   echo "$C"
|   let C=$C+1
| done
+-------------------------------

use the return status of TRUE or FALSE

Does this help?

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)



Reply to: