Question: PLease write below Steps for given Shel Script.. I need Screenshot for each step Basic script to display the content using echo Variables script to
PLease write below Steps for given Shel Script..
I need Screenshot for each step
Basic script to display the content using echo
Variables script to display:
User Input
Conditional Script:
Greater than, less than, equal to comparison script
Loop script:
File handling Script
Function script
Case statement Script:
Arithmetic Operations
Arithmetic operations using expr
Positional Parameters
Loops
IFelse loop
Dowhile loop
Looping through array elements
Searching in array
SHEL SCRIPT:
#binbash
#echo "First Bash
fnamerajco
lnamesiva
echo "welcome to ncpl $fname $lname
#binbash
#echo "First Bash
echo "enter the fname"
read fname
echo "enter the lname
read lname
echo "welcome to ncpl $fname $lname
#binbash
#echo "First Bash
fname$
lname$
echo "welcome to ncpl $fname $lname
#binbash
num
num
numexpr $num $num or num$$num $num or num$expr $num $num
echo $num
#binbash
count
countexpr $count
echo $count
x
y
# matching numbers with
resexpr $x $y
echo $res
# displays when arg is less than arg
resexpr $x $y
echo $res
# display when arg is not equal to arg
resexpr $x $y
echo $res
#binbash
# reading data from the user
read r p "Enter a: a
read r p "Enter b: b
add$ab
echo "Addition of a and b are: $add
sub$ab
echo "Subtraction of a and b are: $sub
mul$ab
echo "Multiplication of a and b are: $mul
div$ab
echo "Division of a and b are: $div
mod$ab
echo "Modulis of a and b are: $mod
a
echo "Increment operator when applied on $a results into a :$a
b
echo "Decrement operator when applied on b results into b :$b
#binbash
#reading data from the user
read p 'Enter a : a
read p 'Enter b : b
if $a$b
then
echo a is equal to b
else
echo a is not equal to b
fi
if $a$b
then
echo a is not equal to b
else
echo a is equal to b
fi
if $a$b
then
echo a is less than b
else
echo a is not less than b
fi
if $a$b
then
echo a is less than or equal to b
else
echo a is not less than or equal to b
fi
if $a$b
then
echo a is greater than b
else
echo a is not greater than b
fi
if $a$b
then
echo a is greater than or equal to b
else
echo a is not greater than or equal to b
fi
#binbash
#reading data from the user
read p 'Enter a : a
read p 'Enter b : b
if$a "true" & $b "true"
then
echo Both are true.
else
echo Both are not true.
fi
if$a "true" $b "true"
then
echo Atleast one of them is true.
else
echo None of them is true.
fi
if $a "true"
then
echo a was initially false.
else
echo a was initially true.
fi
#binbash
#reading data from the user
read p 'Enter a : a
read p 'Enter b : b
if$a "true" & $b "true"
then
echo Both are true.
else
echo Both are not true.
fi
if$a "true" $b "true"
then
echo Atleast one of them is true.
else
echo None of them is true.
fi
if $a "true"
then
echo a was initially false.
else
echo a was initially true.
fi
#binbash
#reading data from the user
read p 'Enter a : a
read p 'Enter b : b
bitwiseAND$ a&b
echo Bitwise AND of a and b is $bitwiseAND
bitwiseOR$ ab
echo Bitwise OR of a and b is $bitwiseOR
bitwiseXOR$ ab
echo Bitwise XOR of a and b is $bitwiseXOR
bitiwiseComplement$ ~a
echo Bitwise Compliment of a is $bitiwiseComplement
leftshift$ a
echo Left Shift of a is $leftshift
rightshift$ b
echo Right Shift of b is $rightshift
expr length "rajco"
xrajco
lenexpr length $x
echo $len
:$d
#binbash
echo "Enter the value a
read a
if $a lt
then
echo $a is leass than
fi
I need Screenshots please for all above steps..
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
