You can pass some data into the script using arguments.
Also the same is valid for a function which we will cover in other lecture example of calling a script
with some arguments.
We can see right now as Usually we are running descript but at the end we are adding arguments separated
with space.
In our case no arguments two three can be read from the script itself and then further persist Hovey
can access arguments from the script script name can be accessed as a dollar sign zero first argument
as a dollar sign.
Second argument as do all our assigned to and so on.
Then we have option how to show or arguments using dollar sign at end using a dollar sign Aztec's.
Here it is good to know.
Did the option go out of sight.
Asterix is returning only once thing where the arguments are separated.
Using first character of internal field separator which is usually space because of this.
Once that limitation in most scripts this option is not lost when reading processing arguments to easily
check how many arguments was entered we are using a dollar sign half.
Now let's write some script to see arguments in action.
I will create a script called arguments s h
on the first line.
Don't forget on shoving Ben Bash.
Now I will print the script name using echo script name
and the value is displayed using assign zero.
Also I can for example print first and second arguments for arguments using sign one and the second
argument.
I will display using dollar sign to.
Now I can print or arguments using dollar signs or arguments with Dollar Sign
here.
I need to prepend backslash before dollar sign at if I want to display a string dollar sign at instead
of its value
on the next line I can proceed or argument using dollar sign stakes
all agreements with don't forget on backslash
and value assign stakes.
And finally we can display argument count using dollar sign hash.
Now the script is dumb so we can save it
grant permission
and we can run it.
Now you see that we didn't use any arguments so arguments count is zero.
So we can change it.
So I will add one to three.
Great we see now that first argument is a 1 second is number 2.
We also see or are we ones written by dollar sign and dollar sign stakes.
Here you see that output is same for both of them and in this example is hard to spot any difference
between them but it is a way to lecture where we will talk about for a loop as that.
I can show you the difference when reading arguments using Gloup.