Perhaps the strangest expansion is called the Brays expansion.
Actually, let me write that down here.
So the in this lecture we will learn about the brace.
Expansion.
So.
A we it with the brakes expansion, you can create a multiple text strings from a pattern containing
braces.
So for example this here let me change this to here.
So echo for example.
And make it Oxley.
And A, B, C, D and academy.
And as you can see here, we can here.
This is the following output.
Occella Academy.
Occella.
B Occella.
C Academy.
Occella.
D Academy.
So patterns to be expanded may contain a leading portion called the preamble and a trailing portion
called a postscript.
So the brace expansion itself may contain either a comma separated list of strings or a range of integers
or a single character.
So the pattern may not contain unquoted whitespace.
So here is an example for example.
Echo.
So now.
We will.
Right.
Following example lectures.
Lecture number.
And here for example.
Lecture number from one to.
20 here.
Not like this.
Here.
That's it.
And as you can see here, lecture number one.
Lecture number two, lecture number three, four, five, six, seven, eight.
And from two, from 1 to 20, I think you are getting the.
Logic of this expansion here.
So now we can also do it like that.
So clear.
Clear.
And echo zero one from zero 1 to 99 here.
And we will get this following output here.
And you can also do it from, for example, 0010012099.
And you will also get this output.
So if you try that sometime, something like that.
And here you will also get the same output because it starts with 001 and then ends to 99.
Here you can also do something like that, for example.
Echo.
You can use the range of letters in a reverse order like this.
So from Z to A and here and as you can see here, we got from Z to X.
And lastly A here for so we reversed the letters here.
So and you can also reverse this numbers here.
So you can also write from 99 to 1.
So for example, echo 99 to 1.
And here you can also do it from zero 99.
Zero nine 9 to 1, and you can also do zero 99 to 0 100.
And as you can see here, zero 99 and lastly, zero 100.
So let's think of like that.
What is this good for?
The most common application is to make lists of files or directories to be created.
For example, if we were photographers and had a large collection of images that we wanted to organize
into years and months, the first thing we might do is create a series of directories named for example,
and actually let me write it down here so you will understand better.
So the first thing we're going to do is create a series of directories named, for example, year.
Year and after month.
So.
So this way the directory names would sort in a chronological order and we will type out a complete
list of directories.
But that's a lot of work in this case.
But in and it's error prone.
So instead we could do here in next example.
But firstly what we want to do here for example October, October.
And the month is going to be, for example, no year year for.
So first we're going to write a year here.
So year is going to be, for example, 2020 4th October.
And inside this we're going to have the photographs.
So this is going to be directory here and this is going to be our directory.
And inside this we're going to save and order photographs in it.
So let's get started with our example now.
And here.
But first we're going to here.
So firstly, we're going to go to documents or another directory.
So we will want won't see the other users directories here or let's actually go to CD, my dear one.
And so we don't have any files in it.
That's good.
And for example make their photos yet.
Yeah, photos.
And here we created the deer photos.
So we're going to see the two photos here.
Photos.
And now.
We will make the deal here.
So now that's here, for example, my card here and from 2024 or 2022.
From 2020 to.
2025 and here and we will also write the month number.
So in this case, the month numbers is going to be
010203040506.
Also
070809.
Uh, not zero here.
Ten and 11 and 12.
So the months order is going to be like this here.
So let's here in order to do that, we will write it.
012.
12.
And here let's create enter and here, let's see the magic here, LZ.
And as you can see here, LZ here.
And as you can see here, actually, we did an mistake here because we did write it like that.
So now let's actually see what did create, uh, we what did we create?
And here, as you can see here, we created actually we did mistyped the error.
Instead of writing this, we need have to write two space characters so clear, let's write it again
so we don't have any files.
LZ And here.
We will do m-code here and from 2020.
To 2025.
And here.
Zero one from zero one.
To 12.
And here, as you can see here, we did create our folders for it.
So, for example, this is 2021, 2022, 2023, 2024.
And it goes like this to from 2021 to our 20 2512 here.
And this is pretty like magic, right?
So in next lecture you will also learn about the parameter expansion.
So I'm waiting you in next lecture.