Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Concealing keyboard input? Or how to display *****'s instead of text

Posted on 2006-07-24
3
213 Views
Last Modified: 2010-04-22
Hi,
I'm writing a bash script to run under Cygwin to change users passwords on a Windows domain controler. My script uses the Windows "net user" command and I feed it the password as a variable.

In my script I'm using "read" to capture keyboard input into a variable but ofcourse the password is displayed on the screen. Is there a way I can conceal the password input with *****'s?
0
Comment
Question by:veedar
3 Comments
 
LVL 11

Accepted Solution

by:
grsteed earned 250 total points
ID: 17171709
This isn't exactly what your looking for but it does blank out the password entry.

# Turn off echo
stty -echo
echo -n "Enter Password: "
read password
stty echo

The last line turns the echo back on.

Cheers,
Gary
0
 
LVL 8

Assisted Solution

by:manish_regmi
manish_regmi earned 250 total points
ID: 17173306
How about using expect.

expect -re "Password '.*': "

http://expect.nist.gov/

regards
Manish Regmi
0
 
LVL 15

Author Comment

by:veedar
ID: 17176847
Thanks, blanking it out will work for me.

And a relevant expect doc here....
http://expect.nist.gov/doc/bgpasswd.pdf
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
A "Helper" for python 2 102
troubleshooting a process that crashes within 3 mins 11 99
Getting permission denied on linux running a script 3 70
Error while installing rpm 1 85
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question