Advertisement
LightProgrammer000

Configurar data [linux]

Jul 18th, 2021
2,377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. clear
  4. echo -e "\033[01;33m ====================\033[01;37m"
  5. echo -e "\033[01;32m         DATA        \033[01;37m"
  6. echo -e "\033[01;33m ====================\033[01;37m"
  7. echo ""
  8.  
  9.  
  10. echo -n -e "\033[01;34m # Dia (Ex: 18): \033[01;37m"
  11. read dia
  12.  
  13. echo -n -e "\n\033[01;35m # Mes (Ex: 07): \033[01;37m"
  14. read mes
  15.  
  16. echo -n -e "\n\033[01;36m # Ano (Ex: 2021): \033[01;37m"
  17. read ano
  18.  
  19. echo -n -e "\n\033[01;37m # Hora (Ex: 15): \033[01;37m"
  20. read hora
  21.  
  22. echo -n -e "\n\033[01;38m # Minuto(s) (Ex: 56): \033[01;37m"
  23. read minuto
  24.  
  25. #  Comando em exemplo -> date -s "07/18/2021 15:51:00"
  26. var=$(date -s "$mes/$dia/$ano $hora:$minuto:00")
  27.  
  28. # Apresentacao
  29. echo -n -e "\n\033[01;31m # Resultado: $var\033[01;37m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement