1 00:00:00,490 --> 00:00:04,420 Perhaps the strangest expansion is called the Brays expansion. 2 00:00:04,420 --> 00:00:06,270 Actually, let me write that down here. 3 00:00:06,280 --> 00:00:10,510 So the in this lecture we will learn about the brace. 4 00:00:12,310 --> 00:00:13,270 Expansion. 5 00:00:18,440 --> 00:00:19,130 So. 6 00:00:20,370 --> 00:00:26,730 A we it with the brakes expansion, you can create a multiple text strings from a pattern containing 7 00:00:26,730 --> 00:00:27,210 braces. 8 00:00:27,210 --> 00:00:32,460 So for example this here let me change this to here. 9 00:00:32,460 --> 00:00:34,740 So echo for example. 10 00:00:35,790 --> 00:00:38,850 And make it Oxley. 11 00:00:40,340 --> 00:00:47,600 And A, B, C, D and academy. 12 00:00:48,290 --> 00:00:50,810 And as you can see here, we can here. 13 00:00:50,810 --> 00:00:51,890 This is the following output. 14 00:00:51,930 --> 00:00:52,970 Occella Academy. 15 00:00:52,970 --> 00:00:53,300 Occella. 16 00:00:53,330 --> 00:00:54,590 B Occella. 17 00:00:54,620 --> 00:00:55,310 C Academy. 18 00:00:55,310 --> 00:00:55,700 Occella. 19 00:00:55,700 --> 00:00:56,600 D Academy. 20 00:00:56,690 --> 00:01:03,590 So patterns to be expanded may contain a leading portion called the preamble and a trailing portion 21 00:01:03,590 --> 00:01:06,050 called a postscript. 22 00:01:06,050 --> 00:01:12,230 So the brace expansion itself may contain either a comma separated list of strings or a range of integers 23 00:01:12,230 --> 00:01:13,430 or a single character. 24 00:01:13,430 --> 00:01:16,310 So the pattern may not contain unquoted whitespace. 25 00:01:16,310 --> 00:01:19,460 So here is an example for example. 26 00:01:19,490 --> 00:01:20,300 Echo. 27 00:01:20,480 --> 00:01:21,800 So now. 28 00:01:22,770 --> 00:01:23,250 We will. 29 00:01:24,550 --> 00:01:25,330 Right. 30 00:01:25,360 --> 00:01:27,680 Following example lectures. 31 00:01:27,700 --> 00:01:30,040 Lecture number. 32 00:01:30,040 --> 00:01:32,050 And here for example. 33 00:01:32,050 --> 00:01:35,200 Lecture number from one to. 34 00:01:36,600 --> 00:01:37,880 20 here. 35 00:01:38,370 --> 00:01:39,060 Not like this. 36 00:01:39,060 --> 00:01:39,540 Here. 37 00:01:39,570 --> 00:01:40,350 That's it. 38 00:01:40,350 --> 00:01:43,620 And as you can see here, lecture number one. 39 00:01:43,620 --> 00:01:47,700 Lecture number two, lecture number three, four, five, six, seven, eight. 40 00:01:47,700 --> 00:01:53,010 And from two, from 1 to 20, I think you are getting the. 41 00:01:54,200 --> 00:01:56,410 Logic of this expansion here. 42 00:01:56,650 --> 00:02:00,110 So now we can also do it like that. 43 00:02:00,130 --> 00:02:01,360 So clear. 44 00:02:01,390 --> 00:02:02,290 Clear. 45 00:02:02,290 --> 00:02:08,650 And echo zero one from zero 1 to 99 here. 46 00:02:08,650 --> 00:02:13,110 And we will get this following output here. 47 00:02:13,120 --> 00:02:21,880 And you can also do it from, for example, 0010012099. 48 00:02:21,880 --> 00:02:23,860 And you will also get this output. 49 00:02:23,860 --> 00:02:26,560 So if you try that sometime, something like that. 50 00:02:26,950 --> 00:02:35,890 And here you will also get the same output because it starts with 001 and then ends to 99. 51 00:02:35,890 --> 00:02:38,650 Here you can also do something like that, for example. 52 00:02:38,680 --> 00:02:39,460 Echo. 53 00:02:40,000 --> 00:02:40,660 Echo. 54 00:02:40,960 --> 00:02:45,400 You can use the range of letters in a reverse order like this. 55 00:02:45,400 --> 00:02:52,650 So from Z to A and here and as you can see here, we got from Z to X. 56 00:02:52,660 --> 00:02:58,040 And lastly A here for so we reversed the letters here. 57 00:02:58,040 --> 00:03:02,930 So and you can also reverse this numbers here. 58 00:03:02,930 --> 00:03:06,790 So you can also write from 99 to 1. 59 00:03:06,800 --> 00:03:11,930 So for example, echo 99 to 1. 60 00:03:12,080 --> 00:03:16,940 And here you can also do it from zero 99. 61 00:03:18,820 --> 00:03:27,490 Zero nine 9 to 1, and you can also do zero 99 to 0 100. 62 00:03:27,670 --> 00:03:33,070 And as you can see here, zero 99 and lastly, zero 100. 63 00:03:33,070 --> 00:03:35,700 So let's think of like that. 64 00:03:35,710 --> 00:03:38,470 What is this good for? 65 00:03:38,500 --> 00:03:43,840 The most common application is to make lists of files or directories to be created. 66 00:03:43,840 --> 00:03:50,560 For example, if we were photographers and had a large collection of images that we wanted to organize 67 00:03:50,560 --> 00:03:58,540 into years and months, the first thing we might do is create a series of directories named for example, 68 00:03:58,930 --> 00:04:03,330 and actually let me write it down here so you will understand better. 69 00:04:03,340 --> 00:04:12,100 So the first thing we're going to do is create a series of directories named, for example, year. 70 00:04:12,840 --> 00:04:15,290 Year and after month. 71 00:04:17,980 --> 00:04:18,640 So. 72 00:04:18,940 --> 00:04:26,140 So this way the directory names would sort in a chronological order and we will type out a complete 73 00:04:26,140 --> 00:04:26,920 list of directories. 74 00:04:26,920 --> 00:04:29,080 But that's a lot of work in this case. 75 00:04:29,080 --> 00:04:31,060 But in and it's error prone. 76 00:04:31,060 --> 00:04:35,230 So instead we could do here in next example. 77 00:04:35,230 --> 00:04:41,260 But firstly what we want to do here for example October, October. 78 00:04:45,250 --> 00:04:49,060 And the month is going to be, for example, no year year for. 79 00:04:49,060 --> 00:04:51,370 So first we're going to write a year here. 80 00:04:51,370 --> 00:04:56,650 So year is going to be, for example, 2020 4th October. 81 00:04:56,650 --> 00:04:59,800 And inside this we're going to have the photographs. 82 00:05:00,070 --> 00:05:03,910 So this is going to be directory here and this is going to be our directory. 83 00:05:03,910 --> 00:05:08,440 And inside this we're going to save and order photographs in it. 84 00:05:08,440 --> 00:05:10,870 So let's get started with our example now. 85 00:05:12,000 --> 00:05:13,200 And here. 86 00:05:13,260 --> 00:05:15,090 But first we're going to here. 87 00:05:15,090 --> 00:05:18,540 So firstly, we're going to go to documents or another directory. 88 00:05:18,540 --> 00: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. 89 00:05:27,870 --> 00:05:30,450 And so we don't have any files in it. 90 00:05:30,450 --> 00:05:31,050 That's good. 91 00:05:31,050 --> 00:05:35,220 And for example make their photos yet. 92 00:05:35,310 --> 00:05:36,360 Yeah, photos. 93 00:05:36,390 --> 00:05:38,640 And here we created the deer photos. 94 00:05:38,640 --> 00:05:40,770 So we're going to see the two photos here. 95 00:05:41,530 --> 00:05:42,250 Photos. 96 00:05:43,570 --> 00:05:44,890 And now. 97 00:05:46,550 --> 00:05:49,700 We will make the deal here. 98 00:05:49,700 --> 00:06:02,810 So now that's here, for example, my card here and from 2024 or 2022. 99 00:06:04,500 --> 00:06:06,210 From 2020 to. 100 00:06:07,510 --> 00:06:12,970 2025 and here and we will also write the month number. 101 00:06:12,970 --> 00:06:15,640 So in this case, the month numbers is going to be 102 00:06:15,670 --> 00:06:24,760 010203040506. 103 00:06:24,790 --> 00:06:25,660 Also 104 00:06:25,960 --> 00:06:31,360 070809. 105 00:06:31,840 --> 00:06:33,220 Uh, not zero here. 106 00:06:33,220 --> 00:06:36,400 Ten and 11 and 12. 107 00:06:36,400 --> 00:06:40,510 So the months order is going to be like this here. 108 00:06:40,510 --> 00:06:45,280 So let's here in order to do that, we will write it. 109 00:06:45,280 --> 00:06:47,200 012. 110 00:06:47,960 --> 00:06:48,620 12. 111 00:06:48,920 --> 00:06:56,280 And here let's create enter and here, let's see the magic here, LZ. 112 00:06:56,330 --> 00:06:58,790 And as you can see here, LZ here. 113 00:06:58,790 --> 00:07:04,460 And as you can see here, actually, we did an mistake here because we did write it like that. 114 00:07:04,460 --> 00:07:09,980 So now let's actually see what did create, uh, we what did we create? 115 00:07:09,980 --> 00:07:14,420 And here, as you can see here, we created actually we did mistyped the error. 116 00:07:14,420 --> 00:07:22,370 Instead of writing this, we need have to write two space characters so clear, let's write it again 117 00:07:22,370 --> 00:07:24,140 so we don't have any files. 118 00:07:24,170 --> 00:07:25,820 LZ And here. 119 00:07:27,090 --> 00:07:33,420 We will do m-code here and from 2020. 120 00:07:34,950 --> 00:07:36,660 To 2025. 121 00:07:36,660 --> 00:07:38,070 And here. 122 00:07:40,100 --> 00:07:42,740 Zero one from zero one. 123 00:07:44,660 --> 00:07:45,920 To 12. 124 00:07:47,090 --> 00:07:53,210 And here, as you can see here, we did create our folders for it. 125 00:07:53,210 --> 00:07:59,870 So, for example, this is 2021, 2022, 2023, 2024. 126 00:07:59,870 --> 00:08:07,190 And it goes like this to from 2021 to our 20 2512 here. 127 00:08:07,490 --> 00:08:11,240 And this is pretty like magic, right? 128 00:08:11,690 --> 00:08:14,930 So in next lecture you will also learn about the parameter expansion. 129 00:08:14,930 --> 00:08:16,250 So I'm waiting you in next lecture.