Created
September 4, 2013 02:09
-
-
Save gabrielkfr/6432026 to your computer and use it in GitHub Desktop.
Script demostrativo que detalla la programación necesaria para ocultar la contraseña cuando se la introduce durante la ejecución de un script bash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# SCRIPT DE PRUEBA - LEER CONTRASENIAS | |
# ==================================== | |
# | |
# -- Se guarda la configuracion de la sesion | |
# stty actual. | |
STTY_SAVE=`stty -g` | |
stty -echo | |
# -- Se solicita la introduccion del password al | |
# usuario: | |
echo | |
echo -n "Introduzca su password: " | |
read SECRET_PASSWD | |
# -- Se restablece la sesion stty anterior. | |
stty $STTY_SAVE | |
echo | |
# -- Despliegue del password: | |
echo | |
echo "El password introducido fue: $SECRET_PASSWD" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment