Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hide password help

Status
Not open for further replies.

timtrust123

Programmer
Dec 19, 2003
19
GB
I have a simpe script that requires input from the user for the account name and password. I would like to be able to hide the password from being displayed on the screen. For example a password of "test" would display ****.

Any ideas out there?

Script

print "please enter your user ID\n";
$username = <STDIN>;
#chomp $feds_username ;

#print "please enter your password\n\n";
#$password = <STDIN>;
#chomp $feds_username ;



Output

please enter your user ID
testuser

please enter your password
test
 
Tim,

Use the searchj function here. This has come up recently, but I'm just running out the door

--Paul
 
a very simple way to do this is stty, look at man pages
stty -echo # disable printing on output
ask passwd
stty echo # reenable printing on output
:) guggach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top