Okay.
Now it's time to talk about the loops in the script.
Now let's start with the for loop so as the asset that we created previously now here so the syntax
is like that for the variable which is I kn and then what the sequence.
So for example I will use the braces like that and I will put in double quotation one.
And coma to arrest.
And three.
Now, do put the command you want.
For example, Brent, I.
Then done.
So it is like that for I in the sequence then do done and inside it equal the I so it will print and
to three.
No.
It's on this desk that you can see that there's one, two, three.
All right, cool.
Now we can have a sequence and read from a file.
So, for example, let's touch list the text and let's them list the text.
And inside it.
Let what first one or two third.
Values, blah, blah, blah.
Okay, whatever.
Now, here, inside the astute edge.
This time I want to bring this file.
But how did we learn to boot and run?
Comment inside the batch script.
Yes, you are right.
Using either the backwardation like that or the dollar sign with buckets.
Let's put the back quotation, back single quotation, and let's put cat list dot text and then let's
equal I.
So let's run as it as here you can see that it will print first to third the values of the file.
Also we can have.
Practical usage, like we want to bring out a range of IP addresses so far.
Let's put this from one W dot and then OC.
Now here echo
129.168.0.
the I and ISP 123 until we reach ten OC.
So let's save and run to see what the value is.
You can see that one, two, three, four until we reach ten OC.
So this is a practical example to generate IPS, for example.
OC Now this is for the for.
Now we have another syntax for the loops, which is the wide loops OC just as the programming languages,
by the way, it is the same.
So let's delete this.
The syntax is like that.
While then put inside a brackets, make sure to follow.
As we learned from the files, there is a spaces between here.
Now here we can put the wild thing.
Okay, first, let's put a counter.
This is just an example.
Equal one.
Or let's just.
Okay, now the dollar sign counter is dash t, which means less than ten, for example.
And make sure there is the spaces.
Then we will put, do.
And after we finish, done.
And inside the Y loop, we want to echo, for example.
The counter.
Okay.
And after we print the counter, we can use this command, which is putting two double brackets counter
plus plus like that.
So this will increase the counter.
Let's run it.
And you can see it will start showing one, two, three and two will reach nine and ten is not included
to include it.
Actually, it's not less than is less or equal.
So l e oc and save it.
Now let's run again.
Yeah, you can see one, two until we reach ten.