Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

answer correct please dont answer the same answer that i already wrote because t

ID: 3902147 • Letter: A

Question

answer correct please dont answer the same answer that i already wrote because there is an error Zain KW LTE 23:01 @ 42%.D. write a shell script programming to find the maximum of three number i wrote a program but it doesnt work please help? /bin/bash echo enter the first nunber read flrst echo "enter the second nunber read second echo "enter the third nunber" read thtrd if [Sftrst gt ssec]: then f sfirst gt $third ] then echo -e "Sfirst ts the naxtnun nunber else echo e "Sthtrd ts the naxtnun nunber ft else if [Ssecond gt $thtrd ] then echo -e "ssecond ts the naxtnun nunber else echo -e "Sthtrd is the naxtnun nunber" ft ft ter the first nuibe enter the second number enter the third number max3.sh: 8: max3.sh: [13: not found max3.sh: 15: max3.sh: [22: not found e 4 is the maximum number

Explanation / Answer

The shell code is as follows:

echo Enter 3 numbers with spaces in between
read a b c #reading three space separated numbers
l=$a # first l is equal to a
if [ $b -gt $l ] # if b greater than l then l is equal to b
then
l=$b
fi
if [ $c -gt $l ] # if c greater than l then l is equal to c
then
l=$c
fi
echo Lagest of $a $b $c is $l

Sample output: