LDP/LDP/guide/docbook/abs-guide/secret-pw.sh

30 lines
621 B
Bash

#!/bin/bash
# secret-pw.sh: secret password
echo
echo -n "Enter password "
read passwd
echo "password is $passwd"
echo -n "If someone had been looking over your shoulder, "
echo "your password would have been compromised."
echo && echo # Two line-feeds in an "and list."
stty -echo # Turns off screen echo.
# May also be done with
# read -sp passwd
# A big Thank You to Leigh James for pointing this out.
echo -n "Enter password again "
read passwd
echo
echo "password is $passwd"
echo
stty echo # Restores screen echo.
exit 0
# Do an 'info stty' for more on this useful-but-tricky command.