1
00:00:02,620 --> 00:00:09,460
So let's start building our final script grade file called files that age

2
00:00:13,020 --> 00:00:17,070
on different lines starting with champagne.

3
00:00:19,660 --> 00:00:28,150
And on the next line write description what we are going to build that we are building script files

4
00:00:28,420 --> 00:00:38,410
as age which can takes barometers dish out followed by location or parameter location followed by location

5
00:00:39,140 --> 00:00:53,650
then barometer E followed by extension or parameter extension followed by extension then it can express

6
00:00:53,810 --> 00:01:04,800
Meteora age or barometer help.

7
00:01:04,810 --> 00:01:09,380
Now we need to know what parameters are selected by user.

8
00:01:09,380 --> 00:01:12,570
So we will read arguments.

9
00:01:12,770 --> 00:01:20,480
So right while number of arguments is greater than zero.

10
00:01:20,480 --> 00:01:29,550
So for that condition we will perform something between keyboards do and an.

11
00:01:29,760 --> 00:01:33,710
Now we need to ask what is the first argument

12
00:01:41,620 --> 00:01:48,440
and if the first argument is Desch how or does the education

13
00:02:00,840 --> 00:02:04,950
we will assign into variable location

14
00:02:07,740 --> 00:02:12,000
value of second argument.

15
00:02:12,000 --> 00:02:13,250
Why.

16
00:02:13,260 --> 00:02:20,670
Because we are expecting a location of value right after the parameter or a parameter location.

17
00:02:24,080 --> 00:02:31,400
We can ensure that value of variable location is really a directory using this thing operand.

18
00:02:31,490 --> 00:02:31,960
The

19
00:02:43,530 --> 00:02:52,910
and if location is not a directory we can put an end to user information how to use our script

20
00:02:56,570 --> 00:03:05,040
so override each Richie's function will create lately.

21
00:03:05,330 --> 00:03:12,920
Now if location is a directory we can throw away two arguments one for barometer and one for location

22
00:03:12,950 --> 00:03:14,770
value.

23
00:03:16,160 --> 00:03:21,860
So now if the first argument is to eat or a dish dish extension

24
00:03:27,440 --> 00:03:38,500
we will assign it to variable x the value of second argument.

25
00:03:39,180 --> 00:03:42,540
Second argument is represented as dollar sign too.

26
00:03:43,230 --> 00:03:47,310
And then you can just throw away first two arguments.

27
00:03:47,340 --> 00:03:57,660
This is the same as we did for obligacion.

28
00:03:58,650 --> 00:04:04,650
If the first argument is that s or a dash dash starts before now

29
00:04:07,290 --> 00:04:13,410
just for that argument because we will come back to this section later.

30
00:04:17,180 --> 00:04:22,640
And if it is the first argument Desch age or does it help

31
00:04:32,970 --> 00:04:40,330
the fro of a moment and also you can display some usage information.

32
00:04:40,350 --> 00:04:42,480
So we are calling function usage

33
00:04:46,490 --> 00:04:55,940
and now if the first argument has some different value with that friend to users information how to

34
00:04:55,940 --> 00:04:57,020
use our script.

35
00:04:57,020 --> 00:04:59,390
So again calling the function usage

36
00:05:02,640 --> 00:05:12,030
now we can close K-State and then and we can right now the usage function because it is not defined

37
00:05:12,030 --> 00:05:16,120
it.

38
00:05:16,770 --> 00:05:21,950
So before the actual calling of that function we are creating a function usage

39
00:05:24,960 --> 00:05:31,410
and in that function we can print using equal command

40
00:05:34,070 --> 00:05:34,950
use each

41
00:05:37,710 --> 00:05:43,610
dollar sign zero which represents scathed name.

42
00:05:43,740 --> 00:05:53,100
And then we can just copy the description from our own and after pasting this

43
00:06:00,120 --> 00:06:07,690
we can also put into some examples it will be good for them to see how the script can be used in some

44
00:06:07,690 --> 00:06:08,540
examples.

45
00:06:18,760 --> 00:06:31,870
So now on a new line we can write to using eco command for example examples and then we need to specify

46
00:06:32,050 --> 00:06:33,770
some examples.

47
00:06:34,030 --> 00:06:42,730
So on another line again Rideman eco commom and right have to assign zero which represents our script

48
00:06:42,730 --> 00:06:44,120
name.

49
00:06:44,140 --> 00:06:54,440
And you can use for example our barometer for location and also you can specify Paromita the parameter

50
00:06:54,450 --> 00:06:56,380
s and on.

51
00:06:56,410 --> 00:07:08,890
Another example we can for example specify the parameter and parameter starts and that's all.

52
00:07:09,220 --> 00:07:16,320
And exit this function with X is that those 1.

53
00:07:16,370 --> 00:07:27,830
Now we have basic structure of our script so we can say it is a good permissions.

54
00:07:28,410 --> 00:07:33,990
And for now that I do run into but I meet are out and do some allocation

55
00:07:41,780 --> 00:07:45,980
it doesn't print anything which is good as no error is printed.

56
00:07:46,040 --> 00:07:48,520
Same with parameter as.

57
00:07:50,240 --> 00:07:53,250
And then we can ask for help

58
00:07:57,390 --> 00:07:58,330
and it is working.

59
00:07:58,330 --> 00:07:59,450
We see usage message.

60
00:07:59,470 --> 00:08:01,000
Good.

61
00:08:01,140 --> 00:08:05,470
Now we can check if you get error message 4 extension parameter

62
00:08:11,440 --> 00:08:13,060
and no we didn't.

63
00:08:13,060 --> 00:08:14,930
It worked fine for now.

64
00:08:15,220 --> 00:08:20,620
So in next lecture we can add more functionality into our script.
