Advertisement
sergio_educacionit

elif.sh

Apr 15th, 2025
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. read -p "Elija una opcion:
  6.  
  7.     1) opcion 1
  8.     2) opcion 2
  9. " x
  10.  
  11.  
  12. if [ "$x" -eq 1 ]; then
  13.  
  14.     echo "opcion 1"
  15.  
  16. elif [ "$x" -eq 2 ]; then
  17.  
  18.     echo "opcion 2"
  19.  
  20. else
  21.     echo "debe elegir opcion 1 o 2"
  22.  
  23. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement