Linux - Shell operators
Nov 28, 2024
Linux - Shell operators
View Video Transcript
0:00
so till now we have seen the different
0:02
types of variables which we can use into
0:04
the linux shell scripting now here we
0:06
are going to talk about the basic
0:08
operators which we can use into the
0:10
Linux operating system
0:11
what the operators are operators can be
0:14
any symbol we'll be using here like plus
0:17
subtraction addition division
0:19
multiplication subtraction equal to not
0:22
equal to all this but here we have
0:25
different categories of it which we
0:27
should know before we start with the
0:28
operators actually we have this five
0:31
categories very first we have that is
0:33
called as arithmetic operators now as
0:36
discussed we can use a nation sign
0:38
subtraction sign multiplication sign
0:41
this all operators are called as your
0:43
arithmetic operators for programming if
0:46
I want to add two different numbers I
0:48
can go for adding me for using the
0:51
automatical operators by giving the
0:53
first variable plus or the addition sign
0:56
with the second variable that is a plus
0:59
B so those operators where are you I am
1:02
using plus my subtraction division
1:05
multiplication signs are called as a
1:07
mathematical operators next we have that
1:10
is relational operators now if I am
1:12
relating two different variables now for
1:14
example is value equals to one these
1:17
value equals to two I want to check
1:19
whether they are equal or not so that is
1:22
nothing but the relation now I'm
1:23
checking out the relation between both
1:25
the variables if there are equipments
1:27
they are equal if they are not
1:29
equivalent they do not have a relation
1:31
or they are not equal right so those
1:32
kind of variables we can use into the
1:34
relational operators next we have called
1:37
as a boolean operators now Boyan
1:39
operators are generally used where we
1:41
need to define all or and operators like
1:45
if a equals to B B equals to C whether
1:48
it is there or not so it can be all an
1:51
and condition like for example I can
1:54
take a person can be a gender of a
1:57
person can be either male or a female so
2:00
it can be all condition where the input
2:03
which we can define for a variable can
2:05
be a male or a female right it cannot be
2:08
a both so that's reason they are using
2:11
our operators so value can be
2:13
are equal to or not equal to a
2:15
particular value so that kind of
2:17
operators are used into the boolean
2:19
operators the second operator is called
2:21
as and when I'm defining any particular
2:24
letter or if I'm defining my name I can
2:27
add my name into the caps lock on that
2:29
means in capital letters or into a small
2:32
letters so both are my name itself so
2:34
anything can be acceptable correct so
2:37
this value can be added either in small
2:39
case or into upper case so I can add
2:41
both the conditions I can use both the
2:43
conditions so that I will be using and
2:46
conditions so basically all the or and
2:49
and conditions which we use are into the
2:52
boolean operators next we have that is a
2:55
string of traitors not if suppose I am
2:57
adding some condition if I'm adding
2:59
strings now for example the letters
3:02
which we have into the a variable called
3:04
as like ABC into B we have three two one
3:09
so this two are the different variables
3:12
I have added they have different format
3:14
altogether as well
3:15
one is having strain other is having
3:17
number I can check for body variables I
3:20
can compare both the variables if those
3:22
variables contain a true value so it
3:25
will show me the string as true if it
3:27
contains a false value it will show me
3:30
in a string called as false
3:31
so whenever if I want to create a
3:33
condition where I am going to define
3:36
true and false values by comparing my
3:39
different variables that I'll be using
3:41
the string operators the next operators
3:45
we have that is file test operators now
3:48
this operators generally works to test
3:50
for a file content now if suppose I want
3:53
to check my file which I have created is
3:56
of 100 MB or mode or not so I can check
4:00
by using this particular operator
4:01
so this operators will always work on
4:04
file I can check what the file contents
4:06
are what are the letters we have written
4:08
on the file what is the size of the file
4:10
what is the format of the file all the
4:12
tests will be performed on a specific
4:14
file itself so we just need to define
4:17
the file name which we want to test here
4:19
so this 35 basic operators we generally
4:22
have so into the next video I am going
4:24
to explore all the operators one
4:26
one and then we'll see some of the codes
4:29
or some of the script created by using
4:30
this operators
#Computer Education
#Programming
#Scripting Languages
#Software