Advertisement
sergio_educacionit

comparacion_numerica.sh

Jul 20th, 2024
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. a=10
  4. b=5
  5.  
  6. if [ $a -eq $b ]; then
  7.     echo "a es igual a b"
  8. fi
  9.  
  10. if [ $a -ne $b ]; then
  11.     echo "a no es igual a b"
  12. fi
  13.  
  14. if [ $a -lt $b ]; then
  15.     echo "a es menor que b"
  16. fi
  17.  
  18. if [ $a -le $b ]; then
  19.     echo "a es menor o igual a b"
  20. fi
  21.  
  22. if [ $a -gt $b ]; then
  23.     echo "a es mayor que b"
  24. fi
  25.  
  26. if [ $a -ge $b ]; then
  27.     echo "a es mayor o igual a b"
  28. fi
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement