WEBVTT

00:00.490 --> 00:04.420
Perhaps the strangest expansion is called the Brays expansion.

00:04.420 --> 00:06.270
Actually, let me write that down here.

00:06.280 --> 00:10.510
So the in this lecture we will learn about the brace.

00:12.310 --> 00:13.270
Expansion.

00:18.440 --> 00:19.130
So.

00:20.370 --> 00:26.730
A we it with the brakes expansion, you can create a multiple text strings from a pattern containing

00:26.730 --> 00:27.210
braces.

00:27.210 --> 00:32.460
So for example this here let me change this to here.

00:32.460 --> 00:34.740
So echo for example.

00:35.790 --> 00:38.850
And make it Oxley.

00:40.340 --> 00:47.600
And A, B, C, D and academy.

00:48.290 --> 00:50.810
And as you can see here, we can here.

00:50.810 --> 00:51.890
This is the following output.

00:51.930 --> 00:52.970
Occella Academy.

00:52.970 --> 00:53.300
Occella.

00:53.330 --> 00:54.590
B Occella.

00:54.620 --> 00:55.310
C Academy.

00:55.310 --> 00:55.700
Occella.

00:55.700 --> 00:56.600
D Academy.

00:56.690 --> 01:03.590
So patterns to be expanded may contain a leading portion called the preamble and a trailing portion

01:03.590 --> 01:06.050
called a postscript.

01:06.050 --> 01:12.230
So the brace expansion itself may contain either a comma separated list of strings or a range of integers

01:12.230 --> 01:13.430
or a single character.

01:13.430 --> 01:16.310
So the pattern may not contain unquoted whitespace.

01:16.310 --> 01:19.460
So here is an example for example.

01:19.490 --> 01:20.300
Echo.

01:20.480 --> 01:21.800
So now.

01:22.770 --> 01:23.250
We will.

01:24.550 --> 01:25.330
Right.

01:25.360 --> 01:27.680
Following example lectures.

01:27.700 --> 01:30.040
Lecture number.

01:30.040 --> 01:32.050
And here for example.

01:32.050 --> 01:35.200
Lecture number from one to.

01:36.600 --> 01:37.880
20 here.

01:38.370 --> 01:39.060
Not like this.

01:39.060 --> 01:39.540
Here.

01:39.570 --> 01:40.350
That's it.

01:40.350 --> 01:43.620
And as you can see here, lecture number one.

01:43.620 --> 01:47.700
Lecture number two, lecture number three, four, five, six, seven, eight.

01:47.700 --> 01:53.010
And from two, from 1 to 20, I think you are getting the.

01:54.200 --> 01:56.410
Logic of this expansion here.

01:56.650 --> 02:00.110
So now we can also do it like that.

02:00.130 --> 02:01.360
So clear.

02:01.390 --> 02:02.290
Clear.

02:02.290 --> 02:08.650
And echo zero one from zero 1 to 99 here.

02:08.650 --> 02:13.110
And we will get this following output here.

02:13.120 --> 02:21.880
And you can also do it from, for example, 0010012099.

02:21.880 --> 02:23.860
And you will also get this output.

02:23.860 --> 02:26.560
So if you try that sometime, something like that.

02:26.950 --> 02:35.890
And here you will also get the same output because it starts with 001 and then ends to 99.

02:35.890 --> 02:38.650
Here you can also do something like that, for example.

02:38.680 --> 02:39.460
Echo.

02:40.000 --> 02:40.660
Echo.

02:40.960 --> 02:45.400
You can use the range of letters in a reverse order like this.

02:45.400 --> 02:52.650
So from Z to A and here and as you can see here, we got from Z to X.

02:52.660 --> 02:58.040
And lastly A here for so we reversed the letters here.

02:58.040 --> 03:02.930
So and you can also reverse this numbers here.

03:02.930 --> 03:06.790
So you can also write from 99 to 1.

03:06.800 --> 03:11.930
So for example, echo 99 to 1.

03:12.080 --> 03:16.940
And here you can also do it from zero 99.

03:18.820 --> 03:27.490
Zero nine 9 to 1, and you can also do zero 99 to 0 100.

03:27.670 --> 03:33.070
And as you can see here, zero 99 and lastly, zero 100.

03:33.070 --> 03:35.700
So let's think of like that.

03:35.710 --> 03:38.470
What is this good for?

03:38.500 --> 03:43.840
The most common application is to make lists of files or directories to be created.

03:43.840 --> 03:50.560
For example, if we were photographers and had a large collection of images that we wanted to organize

03:50.560 --> 03:58.540
into years and months, the first thing we might do is create a series of directories named for example,

03:58.930 --> 04:03.330
and actually let me write it down here so you will understand better.

04:03.340 --> 04:12.100
So the first thing we're going to do is create a series of directories named, for example, year.

04:12.840 --> 04:15.290
Year and after month.

04:17.980 --> 04:18.640
So.

04:18.940 --> 04:26.140
So this way the directory names would sort in a chronological order and we will type out a complete

04:26.140 --> 04:26.920
list of directories.

04:26.920 --> 04:29.080
But that's a lot of work in this case.

04:29.080 --> 04:31.060
But in and it's error prone.

04:31.060 --> 04:35.230
So instead we could do here in next example.

04:35.230 --> 04:41.260
But firstly what we want to do here for example October, October.

04:45.250 --> 04:49.060
And the month is going to be, for example, no year year for.

04:49.060 --> 04:51.370
So first we're going to write a year here.

04:51.370 --> 04:56.650
So year is going to be, for example, 2020 4th October.

04:56.650 --> 04:59.800
And inside this we're going to have the photographs.

05:00.070 --> 05:03.910
So this is going to be directory here and this is going to be our directory.

05:03.910 --> 05:08.440
And inside this we're going to save and order photographs in it.

05:08.440 --> 05:10.870
So let's get started with our example now.

05:12.000 --> 05:13.200
And here.

05:13.260 --> 05:15.090
But first we're going to here.

05:15.090 --> 05:18.540
So firstly, we're going to go to documents or another directory.

05:18.540 --> 05:27.870
So we will want won't see the other users directories here or let's actually go to CD, my dear one.

05:27.870 --> 05:30.450
And so we don't have any files in it.

05:30.450 --> 05:31.050
That's good.

05:31.050 --> 05:35.220
And for example make their photos yet.

05:35.310 --> 05:36.360
Yeah, photos.

05:36.390 --> 05:38.640
And here we created the deer photos.

05:38.640 --> 05:40.770
So we're going to see the two photos here.

05:41.530 --> 05:42.250
Photos.

05:43.570 --> 05:44.890
And now.

05:46.550 --> 05:49.700
We will make the deal here.

05:49.700 --> 06:02.810
So now that's here, for example, my card here and from 2024 or 2022.

06:04.500 --> 06:06.210
From 2020 to.

06:07.510 --> 06:12.970
2025 and here and we will also write the month number.

06:12.970 --> 06:15.640
So in this case, the month numbers is going to be

06:15.670 --> 06:24.760
010203040506.

06:24.790 --> 06:25.660
Also

06:25.960 --> 06:31.360
070809.

06:31.840 --> 06:33.220
Uh, not zero here.

06:33.220 --> 06:36.400
Ten and 11 and 12.

06:36.400 --> 06:40.510
So the months order is going to be like this here.

06:40.510 --> 06:45.280
So let's here in order to do that, we will write it.

06:45.280 --> 06:47.200
012.

06:47.960 --> 06:48.620
12.

06:48.920 --> 06:56.280
And here let's create enter and here, let's see the magic here, LZ.

06:56.330 --> 06:58.790
And as you can see here, LZ here.

06:58.790 --> 07:04.460
And as you can see here, actually, we did an mistake here because we did write it like that.

07:04.460 --> 07:09.980
So now let's actually see what did create, uh, we what did we create?

07:09.980 --> 07:14.420
And here, as you can see here, we created actually we did mistyped the error.

07:14.420 --> 07:22.370
Instead of writing this, we need have to write two space characters so clear, let's write it again

07:22.370 --> 07:24.140
so we don't have any files.

07:24.170 --> 07:25.820
LZ And here.

07:27.090 --> 07:33.420
We will do m-code here and from 2020.

07:34.950 --> 07:36.660
To 2025.

07:36.660 --> 07:38.070
And here.

07:40.100 --> 07:42.740
Zero one from zero one.

07:44.660 --> 07:45.920
To 12.

07:47.090 --> 07:53.210
And here, as you can see here, we did create our folders for it.

07:53.210 --> 07:59.870
So, for example, this is 2021, 2022, 2023, 2024.

07:59.870 --> 08:07.190
And it goes like this to from 2021 to our 20 2512 here.

08:07.490 --> 08:11.240
And this is pretty like magic, right?

08:11.690 --> 08:14.930
So in next lecture you will also learn about the parameter expansion.

08:14.930 --> 08:16.250
So I'm waiting you in next lecture.
