Virajsinh

Large_Small_Same_Chk_OS_Script

Sep 14th, 2017
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. echo "----------------------------------------------------------"
  2. echo "Check Number is the Largest Number, Smallest Number And Same"
  3. echo "----------------------------------------------------------"
  4.  
  5. echo -n "Enter Number A:"
  6. read a
  7. echo -n "Enter Number B:"
  8. read b
  9. echo -n "Enter Number C:"
  10. read c
  11.  
  12. echo "---------------------------"
  13.  
  14. if [ $a -gt $b -a $a -gt $c ]
  15. then
  16. echo "Number A is Largest"
  17.  
  18. elif [ $b -gt $c -a $b -gt $a ]
  19. then
  20. echo "Number B is Larget"
  21.  
  22. elif [ $c -gt $b -a $c -gt $a ]
  23. then
  24. echo "Number C is Largest"
  25. elif [ $a -eq $b -o $a -eq $c -o $b -eq $c ]
  26. then
  27. if [ $a -eq $b -a $a -eq $c -a $b -eq $c ]
  28. then
  29. echo "---------------------------"
  30. echo "All Value is Same"
  31. echo "---------------------------"
  32. else
  33. echo "---------------------------"
  34. echo "Entered Two Value is Same"
  35. echo "---------------------------"
  36. fi
  37. fi
  38. echo "---------------------------"
  39.  
  40. if [ $a -lt $b -a $a -lt $c ]
  41. then
  42. echo "Number A is Smallest"
  43.  
  44. elif [ $b -lt $c -a $b -lt $a ]
  45. then
  46. echo "Number B is Smallest"
  47.  
  48. elif [ $c -lt $b -a $c -lt $a ]
  49. then
  50. echo "Number C is Smallest"
  51. elif [ $a -eq $b -o $a -eq $c -o $b -eq $c ]
  52. then
  53. if [ $a -eq $b -a $a -eq $c -a $b -eq $c ]
  54. then
  55. echo "---------------------------"
  56. echo "All Value is Same"
  57. echo "---------------------------"
  58. else
  59. echo "---------------------------"
  60. echo "Entered Two Value is Same"
  61. echo "---------------------------"
  62. fi
  63. fi
  64. echo "---------------------------"
Add Comment
Please, Sign In to add comment