password.sh 333 B

123456789101112131415161718
  1. #!/bin/bash
  2. cont=false
  3. while [ $cont = false ]; do
  4. printf "Password:\t"
  5. read -s pass1
  6. printf "\nRepita Password:\t"
  7. read -s pass2
  8. printf "\n"
  9. if [ $pass1 = $pass2 ]; then
  10. pass=$pass1
  11. cont=true
  12. printf "Password correcto.\n"
  13. else
  14. printf "Password incorrecto. Intentelo de nuevo:\n"
  15. fi
  16. done
  17. unset cont pass pass1 pass2