I will create a script called Math s h
you know that on the first line we should start a bit shall bang.
So bin bash let's create a variable called number and assigned to the value 5.
And now you can try on your own.
Stop the video and do the number plus five that light double parentheses brackets an expression.
I row start with.
Well it should be easy.
Well that result equals number plus five.
Remember no spaces around plus sign.
And now we're in the resolved
here is out from a million dollar sign.
Is result so this part is done.
Let's move to double parentheses.
Result equals dollar sign and inside double parentheses just the right number.
Plus five for printing the result.
I will just copy previously created equal wine and just add it to include double parentheses Yes exactly.
Next option would be to use brackets
so.
Or is out.
Equals dollar sign brackets.
And inside it of course number plus five
and now I will again just add it equal line.
So now we can try to use expression exper
sole result equals dollar sign and inside parentheses except for the assigned number
plus five
we could instead of Devey use pectic
and last option is to use B.C
and because it can operate floating balloons live will do number multiply by one point nine.
It is important to have expression in double quotation mark followed by by.
So here we are putting expression in double quotation mark
now by.
And now b c
now we will print the result from B C.
So it's done so we can save and scraped
and of course we need to grant execute permission.
Now around here
and we have some problem here.
So it's online.
So just open again the editor or scraped
by typing said no I can see the lines on a Torah so can you see it.
You can produce some special characters in ECO.
C'mon.
No no don't use apostrophes so I will just add Durbach for marks here and say
and great works perfectly now.
Now we can use knowledge of what we have learned in previous section.
Let's say that we want to do addition of two numbers and those two numbers should be given by user.
Let's do it.
Firstly I will clear the screen and create a file called month to do it.
As age starting with Shaban on the first line as you will be in bash.
Now let's ask user for his input.
Eco Desch an enter first number by any parameter.
We are ensuring that the user will type on the same line as where is our message.
We will ask also for second number
enter second number.
And we will read it by read command
type command.
Do some of that here.
So flat out equals first plus Second no space around equal sign or plus sign.
Now we can print the result and save descript so equal dollar sign first Plus are sign second equals
dollar sign.
Result
and saved descript.
I am changing script permissions so everyone can run it.
And now after changing it I will running
entered for number two and the second number.
Sorry 2 plus 3 equals 5.
Great but let's make some change.
I wrote that command do some b c
result Igor's and into Bechtel's level print ICO.
Now the above quotation marks and inside it we will write some expression for example.
Dollar sign.
First xponent dollar signs second.
Now the pipe and B.C see the difference between light and B.C.E. that don't use any dollar sign in front
of variables where S B C is quite opposite.
And don't forget that for B C you'll need to first print the expression inside double quotation marks.
This is the reason why we are using eco here.
Now let's print the result of that exponent operation equal sign.
First ex-porn symbol Dorson second equals sign rezoned subscript
and right
and the first number two and number three.
Yeah great works nicely.
Two plus three equals five and two exponent symbol three equals eight.
Great works nicely.