In location of your own grade script called explicit
on the first line.
Let's start with a bang
followed by bin bash on the end of the line.
We can create a variable called Count and assign value 5 to it.
Now we would like to display value of variable count.
So we are using common echo count equals dollar assigned count.
Now let's say we need an exit editor
now we need to add executive permission to our script.
Let's do that with changement
and we can see that script can be done.
So let's run it.
Nice.
We can see Count equals five.
It's working perfectly.
Open your script again.
You may have noticed that I used apostrophes in the echo command here without apostrophes.
The script works just fine but in some cases some symbols may be interpreted wrongly and I will just
show you that right.
Ico.
Hello backslash.
Just want to display backslash
on the next line.
Bright eco.
It's a good day to learn and save discrete
running in output.
We see that the backslash wasn't even displayed.
Also we see dead single quotation mark in it's causes some error as Abeche is looking for matching single
quotation mark which cannot be found.
Basically what this means is that some characters has special meaning special function and when we use
them in echo command.
Without apostrophes they are not behaving as normal characters but is something with special function.
Let's open the script again.
And in that script remove the last two lines.
Now let's just use you could come home without any apostrophes and without any special characters to
see that it is working without an issue.
Ico we have a lot sun count oranges save descript and Adani
you'll see that it is working well.
But there let's make some error in assigning a variable
under newline
write count equals
space Sikh's you know that there should be no space next to the equal sign.
When we run the script we got arrows saying six command not found Briefing's dead signing but it's done
and that we want to run a common six.
Now let's check in think of a sentence.
Open the script and Firstly remove the line causing us all to count equal spaces.
Just delete it.
On the new line we can assign some sentence to variable message so type message
equals Hello body and what I did without any apostrophes on the next line.
Just printed message
message is equal to dollar sign message save descript
and that on the
we see that there is an error because we didn't use apostrophes when assigning string sentence Bush
fings did the assigning but is only a message.
Equals Hello.
And then is some command called Buddy.
It is important to not is did assigning bad message equals hello has no importance to underline.
Continue with some command.
You can see here dead no value of message was printed.
In the output we see by the command not found but will happen if we change it to some command which
rarely exits.
Open the script and let's make the change
replace divert badly with some existing command.
For example allow us to save the script and run it.
Here we see that a SQL month was printed and I see content of my directory containing only one script
the message variable was not printed as in the last example.
We basically come across all explicit definition and you know now how to assign a variable using this
method.
But let's finish this lecture with a working script which will print us readable value held by the
so open that script and I will apostrophe's.
And by that I mean double quotation mark at the beginning and a D and a value of variable message.
Now save the script and run it and voila everything works perfectly.