1
00:00:04,160 --> 00:00:07,280
Open our script files and of age

2
00:00:10,730 --> 00:00:16,130
it would be good to know if user has entered some location.

3
00:00:16,150 --> 00:00:23,460
So for that case we can create variable which will as if location was set or not.

4
00:00:25,930 --> 00:00:35,890
So set into variable and let's name it lockset value valuable.

5
00:00:36,550 --> 00:00:39,240
And before starting.

6
00:00:39,400 --> 00:00:44,020
While loop set that variable value 0

7
00:00:51,870 --> 00:00:54,470
and we can also write the command.

8
00:00:54,480 --> 00:00:56,520
What it means.

9
00:00:56,520 --> 00:00:59,980
So 0 represents that location is not set.

10
00:01:00,780 --> 00:01:03,930
And number one

11
00:01:11,370 --> 00:01:18,860
will in that case mean that location was set by an.

12
00:01:18,910 --> 00:01:26,290
So that means if user specified some location and value of variable lockset would be on the device it

13
00:01:26,290 --> 00:01:27,780
will be still zero

14
00:01:32,040 --> 00:01:41,340
in the same way we can create variable starts and these mean if user vaunts from script some statistics

15
00:01:41,850 --> 00:01:52,280
this variable will have to come and revise it if you will have value 0.

16
00:01:52,320 --> 00:01:54,570
We can also write some comment here.

17
00:01:55,020 --> 00:01:57,930
So one means do not display statistics

18
00:02:07,110 --> 00:02:10,230
and one means this by statistics

19
00:02:17,770 --> 00:02:21,450
but why we need that variables in a case of location.

20
00:02:21,460 --> 00:02:28,130
We need to know that information because of a news or don't use location parameter don't specify a location.

21
00:02:28,270 --> 00:02:32,960
We should use his or her current directory.

22
00:02:33,640 --> 00:02:40,660
So after dumb keyboard of a WHILE loop right if statement.

23
00:02:41,920 --> 00:02:46,140
So if a value of variable lockset

24
00:02:51,090 --> 00:02:53,370
is not equal to one

25
00:02:58,670 --> 00:03:06,740
then we can set into variable location output of B W D command.

26
00:03:07,340 --> 00:03:11,690
And for that we will use command substitution.

27
00:03:12,680 --> 00:03:19,860
So if user didn't specify a location we are using current directory.

28
00:03:20,420 --> 00:03:27,280
And after this if statement we can print using eco commom value of variable location

29
00:03:36,890 --> 00:03:45,520
now save the file and we can run the script so we don't parameter it.

30
00:03:45,680 --> 00:03:47,120
My current directory.

31
00:03:47,140 --> 00:03:48,630
OK this is working.

32
00:03:51,060 --> 00:03:55,160
But what if I specify another location.

33
00:03:55,170 --> 00:03:56,820
For example EDC

34
00:04:00,970 --> 00:04:05,400
So using our parameter I specify new directory.

35
00:04:05,680 --> 00:04:13,090
And it prints the location is it is the same it is for bin directory.

36
00:04:13,090 --> 00:04:15,280
This is working.

37
00:04:15,700 --> 00:04:19,020
Now I tried the right tools barometer location

38
00:04:23,440 --> 00:04:25,890
and it is working in the same way.

39
00:04:25,900 --> 00:04:27,040
Great.

40
00:04:27,820 --> 00:04:35,140
And if I use some not existing permit that I will get printed usage message grade.
