Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # declaracion de array sin elementos.
- declare -a argumentos
- # Uso:
- # ./switch_case cmd arg arg arg
- # Almacenar los argumentos en un array.
- argumentos=($@)
- case ${argumentos[0]} in
- hola)
- echo "hola como estas"
- ;;
- chau)
- echo "adios"
- ;;
- *)
- echo "debe indicar si dice hola o chau"
- ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement