Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- saludar (){
- # la funcion recoge su argumento con la variable
- # posicional $1
- echo hola $1
- }
- hora() {
- echo la fecha de hoy es_ $(date)
- }
- read -p "Ingrese nombre: " nombre
- echo "invocando funcion saludar..."
- sleep 0.5
- # se le pasa el argumento a la funcion
- saludar $nombre
- echo "algunas instucciones..."
- sleep 0.5
- echo "otras instucciones..."
- sleep 0.5
- echo 'invocando funcion hora'
- sleep 0.5
- hora
- echo saliendo...
- sleep 0.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement