dcsimg
Linux Today: Linux News On Internet Time.





More on LinuxToday


Understanding the for Loop

Apr 05, 2011, 19:02 (0 Talkback[s])

WEBINAR:
On-Demand

Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers


[ Thanks to Andrew Weber for this link. ]

"The for loop starts with 'for' and is followed by a variable, in the example below 'i'. The for loop is designed to be used with a list of items to work through, like files, numbers, folders, etc. This list must be supplied in some form. The 'do' is followed by the method of manipulation, what you want to do with the information that you are working through. In the example the 'do' is simply to send to screen each of the numbers. Close the for loop with the 'done'."

Complete Story

Related Stories: