echo 'Enter Password:"
read password
echo 'Verifying......."
(etc...)
The purpose is to have the command 'read' echo the password to /dev/null or a
file (doesn't matter). I just do not want to display the "password" when the
user types it in on the screen.
read password > file
and
read password 1>&1 do not work as whatever the user types will still display
on the screen.
I am probably overlooking something very simple but I can't seem to figure it
out. Any help would be appreciated.
This system is a ksh running SCO UNIX 3.2v4.2
TIA
Turns out to be simple, but not obvious.
Try this...
print
print -n "Supervisor: "
read SUP
print -n "Password: "
stty -echo
read PASSWD
stty echo
This is from a ksh script, so you might not want to use the print
command.
Rich
Not simple; in general the shells nowize support such usage. If your shell
doos, you are luckie. If not, then uze "stty" (code not tested!):
old=`stty -g`
stty -echo
read pswd
stty $old
You need to turn echo off when the person puts their password in, eg:
echo "Enter Password: \c"