sergio_educacionit

registro_clientes.sh

Apr 28th, 2026
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. func_info () {
  6.  
  7. # esta variable solo existe dentro de la funcion
  8. # no hay conflito con variables de declaradas a fuera
  9. # con el mismo nombre
  10. local file=registros.log
  11.  
  12.  
  13. echo Nombres: $1 >> $file
  14. echo Edad: $2 >> $file
  15. echo Domicilio: $3 >> $file
  16. echo email: $4 >> $file
  17. echo "--------------" >> $file
  18.  
  19. cat $file
  20.  
  21. }
  22.  
  23.  
  24. read -p "Nombres: " nombres
  25.  
  26. read -p "Edad: " edad
  27.  
  28. read -p "Domicilio: " domicilio
  29.  
  30. read -p "email: " email
  31.  
  32. func_info "$nombres" $edad "$domiclio" $email
Advertisement
Add Comment
Please, Sign In to add comment