I have not much knowledge in batch file programming. I like to know the working of for loop mainly. For this i think a small sample program will be helpful to me. So i want a simple program to display the first 'n' natural numbers.Any help please...
+2
A:
If you are talking about Windows batch programming here you have a natural numbers generator:
for /L %i IN (0,1,9) do @echo %i
Other helpful links to deal with files and so on:
If you are talking about GNU Linux/Unix bash scripting you can go to:
Hope that helps,
Ramon Araujo
2010-09-17 09:14:34
Thanks for the earlier reply. /L stands for what? Please reply.
Sarika
2010-09-17 10:07:01
Look at "FOR /?" for help. /L does a sequence from "start" to "end" in increments of "step". In this case, from 0 to 9 in steps of 1. Official syntax: "FOR /L %variable IN (start,step,end) DO command [command-parameters]"
Aaron D
2010-09-17 16:16:29
@sarika: `/l` or `/L` is for *loop*. Easy, ah?
pipitas
2010-09-17 20:30:40
thanks... comments closed
Sarika
2010-09-22 05:24:30