Advertisement
sergio_educacionit

arrays-2.sh

Feb 10th, 2025 (edited)
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. objetos=( "casa" "perro" "planta" "mesa" )
  4.  
  5.  
  6. echo "Echo elementos del array
  7.  
  8. ${objetos[@]}
  9. "
  10. echo 'Se modfica el indice 2
  11.  
  12. objeto[2]=PLANTA
  13. '
  14.  
  15. objeto[2]=PLANTA
  16.  
  17. echo "
  18. Indice modificado:
  19. ${objeto[2]}
  20.  
  21. Todos los indices
  22.  
  23. ${objetos[@]}
  24. "
  25.  
  26. echo "Cantidad de elementos del array:
  27.  
  28. ${#objetos[@]}
  29. "
  30.  
  31. echo "Indices que componen el array:
  32.  
  33. ${!objetos[@]}"
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement