You are on page 1of 1

# Write a shell script to find smallest of three numbers that are read from the keyboard. #!

/bin/bash echo read read read "Enter 3 number" a b c

if [ $a -eq $b -a $b -eq $c ] then echo "All numbers are equal" exit fi if [ $a -lt $b ] then s1=$a s2=$b else s1=$b s2=$a fi if [ $s1 -gt $c ] then s2=$s1 s1=$c fi echo "smallest number is $s1"

You might also like