1
00:00:01,410 --> 00:00:05,890
You can pass some data into the script using arguments.

2
00:00:06,030 --> 00:00:15,160
Also the same is valid for a function which we will cover in other lecture example of calling a script

3
00:00:15,430 --> 00:00:17,010
with some arguments.

4
00:00:17,170 --> 00:00:26,430
We can see right now as Usually we are running descript but at the end we are adding arguments separated

5
00:00:26,430 --> 00:00:27,820
with space.

6
00:00:27,990 --> 00:00:37,510
In our case no arguments two three can be read from the script itself and then further persist Hovey

7
00:00:37,510 --> 00:00:46,090
can access arguments from the script script name can be accessed as a dollar sign zero first argument

8
00:00:46,330 --> 00:00:48,090
as a dollar sign.

9
00:00:48,370 --> 00:00:51,510
Second argument as do all our assigned to and so on.

10
00:00:52,640 --> 00:01:02,000
Then we have option how to show or arguments using dollar sign at end using a dollar sign Aztec's.

11
00:01:02,180 --> 00:01:04,200
Here it is good to know.

12
00:01:04,450 --> 00:01:05,910
Did the option go out of sight.

13
00:01:05,940 --> 00:01:11,990
Asterix is returning only once thing where the arguments are separated.

14
00:01:12,010 --> 00:01:19,380
Using first character of internal field separator which is usually space because of this.

15
00:01:19,380 --> 00:01:28,480
Once that limitation in most scripts this option is not lost when reading processing arguments to easily

16
00:01:28,480 --> 00:01:35,240
check how many arguments was entered we are using a dollar sign half.

17
00:01:35,260 --> 00:01:40,560
Now let's write some script to see arguments in action.

18
00:01:40,820 --> 00:01:44,710
I will create a script called arguments s h

19
00:01:49,830 --> 00:01:50,790
on the first line.

20
00:01:50,790 --> 00:01:56,630
Don't forget on shoving Ben Bash.

21
00:01:56,770 --> 00:02:03,280
Now I will print the script name using echo script name

22
00:02:06,880 --> 00:02:11,860
and the value is displayed using assign zero.

23
00:02:12,040 --> 00:02:22,850
Also I can for example print first and second arguments for arguments using sign one and the second

24
00:02:22,910 --> 00:02:23,850
argument.

25
00:02:24,250 --> 00:02:32,680
I will display using dollar sign to.

26
00:02:33,050 --> 00:02:44,120
Now I can print or arguments using dollar signs or arguments with Dollar Sign

27
00:02:47,200 --> 00:02:47,890
here.

28
00:02:48,050 --> 00:02:56,390
I need to prepend backslash before dollar sign at if I want to display a string dollar sign at instead

29
00:02:56,420 --> 00:02:57,380
of its value

30
00:03:00,110 --> 00:03:06,910
on the next line I can proceed or argument using dollar sign stakes

31
00:03:10,900 --> 00:03:14,900
all agreements with don't forget on backslash

32
00:03:21,860 --> 00:03:26,630
and value assign stakes.

33
00:03:27,110 --> 00:03:40,300
And finally we can display argument count using dollar sign hash.

34
00:03:40,350 --> 00:03:43,410
Now the script is dumb so we can save it

35
00:03:46,350 --> 00:03:47,950
grant permission

36
00:03:50,580 --> 00:03:52,950
and we can run it.

37
00:03:54,210 --> 00:04:00,780
Now you see that we didn't use any arguments so arguments count is zero.

38
00:04:00,810 --> 00:04:02,340
So we can change it.

39
00:04:03,150 --> 00:04:06,300
So I will add one to three.

40
00:04:06,390 --> 00:04:12,570
Great we see now that first argument is a 1 second is number 2.

41
00:04:12,690 --> 00:04:18,550
We also see or are we ones written by dollar sign and dollar sign stakes.

42
00:04:18,870 --> 00:04:25,560
Here you see that output is same for both of them and in this example is hard to spot any difference

43
00:04:25,560 --> 00:04:31,050
between them but it is a way to lecture where we will talk about for a loop as that.

44
00:04:31,070 --> 00:04:35,240
I can show you the difference when reading arguments using Gloup.
