sergio_educacionit

python_embebido_0.sh

Aug 23rd, 2025 (edited)
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # DeclaraciΓ³n del array
  4.  
  5. sistema=( $(uname -a) )
  6.  
  7. # Llamar al script embebido en Python
  8. var=$(python3 <<EOF
  9.  
  10. system_dict = {
  11. "kernel": "${sistema[0]}",
  12. "dist": "${sistema[1]}",
  13. "version": "${sistema[2]}"
  14. }
  15.  
  16. print(system_dict)
  17. EOF
  18. )
  19.  
  20.  
  21. echo "Diccionario en python: $var"
  22.  
Advertisement
Add Comment
Please, Sign In to add comment