Shell Script To Find Out Biggest Number Form Given Three Numbers - The Coding Shala
Home >> Scripting >> Biggest number Shell Script To Find Out Biggest Number Form Given Three Numbers Write a shell script to find out the biggest number form given three numbers. Numbers are supplied by the command line argument? Code: #! / bin / bash if [ $# - ne 3 ] then echo "enter three argument" exit 1 fi if [ $ 1 - gt $ 2 ] && [ $ 1 - gt $ 3 ] then echo "$1 is biggest number" elif [ $ 2 - gt $ 1 ] && [ $ 2 - gt $ 3 ] then echo "$2 is the biggest number" elif [ $ 3 - gt $ 1 ] && [ $ 3 - gt $ 2 ] then echo "$3 is biggest number" else echo "all numbers are equal" fi Other Posts You May Like Shell script to print sum of all digits Shell script to add two numbers Shell script to find factorial Shell script to generate Fibonacci series Shell script to create a simple calculator Please leave a comment below if you like this post...