1 00:00:00,180 --> 00:00:04,830 OK, now let's use Vim Ed as assets that we created previously. 2 00:00:05,160 --> 00:00:14,310 Now here, my typing Dee Dee Dee Dee letter, I mean, you can see that it will remove a line, no press 3 00:00:14,850 --> 00:00:17,040 eye or depends on what you want. 4 00:00:17,370 --> 00:00:18,300 I will press eye. 5 00:00:18,840 --> 00:00:20,940 So to insert more, as we learned previously. 6 00:00:21,120 --> 00:00:25,000 OK, now here, let's declare our first variable. 7 00:00:25,020 --> 00:00:26,040 So VAR. 8 00:00:27,290 --> 00:00:35,600 Underscore, or let's name it, first underscore, OK, equal, and then let's put inside it in quotation. 9 00:00:37,360 --> 00:00:40,060 This is our first video of it. 10 00:00:41,650 --> 00:00:42,040 OK. 11 00:00:42,520 --> 00:00:50,170 Know how to print its value by typing the name of the variable as simple as that, but before it, let's 12 00:00:50,170 --> 00:00:52,900 book that the last night, I think we already saw that. 13 00:00:53,320 --> 00:01:02,170 But here, using a best script now here in this best script, the first variable in this is, or I haven't 14 00:01:02,170 --> 00:01:03,550 made the mistake, a typo here. 15 00:01:03,820 --> 00:01:04,480 No problem. 16 00:01:04,900 --> 00:01:06,270 This is our first variable. 17 00:01:06,460 --> 00:01:07,480 First variable. 18 00:01:07,720 --> 00:01:13,060 OK, now let's run as the test again, and you can see it will print. 19 00:01:13,330 --> 00:01:15,220 This is our first variable. 20 00:01:15,640 --> 00:01:16,000 Cool. 21 00:01:16,750 --> 00:01:18,490 OK, now this is a string variable. 22 00:01:18,550 --> 00:01:22,180 Now I want let's open as such again. 23 00:01:22,510 --> 00:01:24,710 Now what if I want to create another variable? 24 00:01:24,730 --> 00:01:25,270 It's an image. 25 00:01:25,630 --> 00:01:29,630 Second, and that is caught far and inside it, I want to put a command. 26 00:01:29,630 --> 00:01:30,220 Dallas. 27 00:01:30,460 --> 00:01:35,530 Now, if I type, I just like that and if I equal the first variable. 28 00:01:36,070 --> 00:01:40,570 And by the way, I can put that inside a double quotation like that. 29 00:01:40,840 --> 00:01:41,410 And what? 30 00:01:42,880 --> 00:01:52,990 This is the first variable like this, and with the variable and equal again, the same thing. 31 00:01:54,520 --> 00:01:55,690 This is the second. 32 00:01:56,680 --> 00:01:57,190 Vary a bit. 33 00:01:57,700 --> 00:01:58,080 OK. 34 00:01:59,330 --> 00:02:02,120 And what their second underscore. 35 00:02:04,200 --> 00:02:12,860 But right now, by the way, this to Brent as text and to what the value of the first variable, and 36 00:02:12,900 --> 00:02:16,620 this is again for the second variable, but the second variable values here. 37 00:02:16,980 --> 00:02:19,140 It will not be running as a comment. 38 00:02:19,200 --> 00:02:22,230 It will be as a text or string. 39 00:02:22,470 --> 00:02:26,190 So if I did a search, you can see this is the first variable. 40 00:02:26,220 --> 00:02:28,680 This is our first variable, which is the value of the variable. 41 00:02:28,890 --> 00:02:32,340 And as you can see, the second value is is L.S., which is as a string. 42 00:02:32,730 --> 00:02:41,430 Now how to run a command and what its value inside a variable, we would use the back quotation or single 43 00:02:41,430 --> 00:02:45,270 quotation, which is that tilde mark like this? 44 00:02:45,540 --> 00:02:45,930 OK. 45 00:02:46,110 --> 00:02:53,310 So this means that run as command and the value or the output of this command will be stored inside 46 00:02:53,310 --> 00:02:54,480 this second variable. 47 00:02:54,750 --> 00:03:02,070 By the way, not just the single that quotation, we can use the dollar, sign up in brackets and close 48 00:03:02,070 --> 00:03:03,030 the bracket like this. 49 00:03:03,870 --> 00:03:05,040 Either way, it would work. 50 00:03:05,070 --> 00:03:07,080 OK, now listen again. 51 00:03:07,350 --> 00:03:08,130 Now, let's see. 52 00:03:08,370 --> 00:03:09,030 You can see. 53 00:03:09,030 --> 00:03:17,100 Yeah, it is working because unless I think else in the back of the batch variable, it would show us 54 00:03:17,250 --> 00:03:18,660 as as edge. 55 00:03:18,900 --> 00:03:19,240 OK. 56 00:03:19,260 --> 00:03:20,610 Which means what we want. 57 00:03:20,970 --> 00:03:21,390 OK. 58 00:03:21,870 --> 00:03:24,780 By the way, we can two more options. 59 00:03:24,780 --> 00:03:26,510 Knight allows Shell. 60 00:03:27,120 --> 00:03:29,490 For example, let's see what will show us. 61 00:03:30,210 --> 00:03:32,680 So let's run again as datasets here. 62 00:03:32,700 --> 00:03:40,010 You can see this is the second variable in total, whatever, and this is the value of the additional 63 00:03:40,410 --> 00:03:40,850 comment. 64 00:03:41,250 --> 00:03:41,580 OK. 65 00:03:41,640 --> 00:03:45,270 Also, we can use arguments inside the best script. 66 00:03:45,450 --> 00:03:46,830 Now you can see this image. 67 00:03:46,960 --> 00:03:48,630 Don't worry, I will provide you with it. 68 00:03:48,990 --> 00:03:50,490 By the way, you can get it online. 69 00:03:50,640 --> 00:03:51,840 This is now no secret. 70 00:03:52,220 --> 00:03:56,370 Anyway, so the variable name inside the bash script can be zero. 71 00:03:56,550 --> 00:03:57,810 As you can see, there are signs zero. 72 00:03:57,840 --> 00:04:01,280 This is the name of the best script from one to nine. 73 00:04:01,290 --> 00:04:06,000 This is the first arguments to the best script there are saying with the hashtag a number of arguments. 74 00:04:06,000 --> 00:04:08,850 Best to the best script with it here or. 75 00:04:09,770 --> 00:04:13,010 That sign or arguments, best to the best scripts. 76 00:04:14,200 --> 00:04:15,440 He had to exit strategy. 77 00:04:15,480 --> 00:04:20,560 I think we already saw this and that to double dollar sign. 78 00:04:20,620 --> 00:04:21,450 We already saw this. 79 00:04:21,459 --> 00:04:24,560 This is the process ID of the current script or the iconic bash. 80 00:04:25,190 --> 00:04:30,940 Remember when we ran this on their bash, the use up here, the variable user? 81 00:04:31,000 --> 00:04:36,700 This is the username of the user running the script, which is in our case, which will be Kelly host 82 00:04:36,760 --> 00:04:39,220 name, the host name of the machine random. 83 00:04:39,230 --> 00:04:42,370 And this will provide a random number and line number. 84 00:04:42,380 --> 00:04:43,330 This is or no. 85 00:04:43,360 --> 00:04:46,180 This is the current line number in the script. 86 00:04:46,420 --> 00:04:46,900 OK. 87 00:04:47,320 --> 00:04:49,270 OK, I will not try all of these. 88 00:04:50,140 --> 00:04:52,420 This is an exercise for you to try all of these. 89 00:04:52,660 --> 00:04:56,690 For now, we will use that's just the variable or the arguments. 90 00:04:56,710 --> 00:04:57,160 OK. 91 00:04:57,610 --> 00:05:01,290 So for example, let's open as such again here. 92 00:05:01,780 --> 00:05:04,780 Let's really remove the first and the second variable. 93 00:05:04,870 --> 00:05:06,230 OK, let's see. 94 00:05:06,310 --> 00:05:07,300 Just this eco. 95 00:05:07,510 --> 00:05:09,670 Now, let's delete this, OK? 96 00:05:10,000 --> 00:05:12,700 For example, this is what you wanna know. 97 00:05:12,920 --> 00:05:15,160 I've seen one instead of this. 98 00:05:16,530 --> 00:05:24,720 And they're not saying to OK, so which means this is the first argument, and this is the second argument. 99 00:05:25,050 --> 00:05:30,780 Now, when it's safe and quick, so if I, as I said without providing any argument, you can see that 100 00:05:30,780 --> 00:05:34,170 this is an empty as you can see empty venues. 101 00:05:34,440 --> 00:05:42,660 But if they provide it like this first, then second, you can see that, yeah, this is first and second. 102 00:05:43,080 --> 00:05:43,560 OK. 103 00:05:44,700 --> 00:05:46,260 Now an exercise for you. 104 00:05:46,290 --> 00:05:52,000 I want you to try out all of those variables and the arguments or whatever. 105 00:05:52,020 --> 00:05:52,500 OK. 106 00:05:52,770 --> 00:05:57,270 Also, we can use that heating user input by using the read comment. 107 00:05:57,360 --> 00:05:57,840 OK. 108 00:05:58,200 --> 00:06:01,230 So open the such again. 109 00:06:02,130 --> 00:06:08,550 Now here above that, let's put it read and the read here. 110 00:06:09,620 --> 00:06:15,890 What the name of the variable silver read bar and print out this VAR, believe it. 111 00:06:16,130 --> 00:06:17,810 OK, so let's remove these, actually. 112 00:06:18,320 --> 00:06:19,550 So read the VAR. 113 00:06:19,790 --> 00:06:26,510 It will ask us to provide a value or a string value for VAR, and then we will print it out. 114 00:06:26,600 --> 00:06:29,390 OK, so let's say that let's run again. 115 00:06:29,630 --> 00:06:32,180 As such, press enter. 116 00:06:32,300 --> 00:06:33,470 You can see that here. 117 00:06:33,710 --> 00:06:39,680 It will ask us to provide value so that you're OK, for example, and the value or have been provided 118 00:06:39,830 --> 00:06:40,910 has been printed out. 119 00:06:40,940 --> 00:06:41,780 OK, cool. 120 00:06:41,990 --> 00:06:44,240 Now there is another way or better way. 121 00:06:44,270 --> 00:06:48,720 So actually, instead of writing this to be fancy? 122 00:06:48,980 --> 00:06:49,880 So let's use. 123 00:06:50,920 --> 00:06:55,900 Please provide value, for example, and press they like that. 124 00:06:57,100 --> 00:06:58,870 And if I don't do it again, you can see it. 125 00:06:58,900 --> 00:07:00,040 Please provide the value. 126 00:07:00,460 --> 00:07:03,340 So just for example or whatever. 127 00:07:03,520 --> 00:07:04,960 And this is just OK. 128 00:07:05,200 --> 00:07:05,620 OK. 129 00:07:06,550 --> 00:07:10,360 And actually, this is a very handy and will be used with a lot of stuff. 130 00:07:11,290 --> 00:07:11,680 OK. 131 00:07:11,920 --> 00:07:17,980 Like, please provide your username, your password, or please provide the value you want to try out 132 00:07:17,980 --> 00:07:20,380 or the name of the fight or whatever. 133 00:07:21,190 --> 00:07:21,610 OK.