Operating System - HP-UX
1748210 Members
3670 Online
108759 Solutions
New Discussion юеВ

Re: Stop keyboard input echoing to the screen

 
SOLVED
Go to solution

Stop keyboard input echoing to the screen

I have a script that asks for the root password via a 'read' command, how do I stop this echoing to the screen?
3 REPLIES 3
johnsonpk
Honored Contributor
Solution

Re: Stop keyboard input echoing to the screen

Hello

Try somthing below

#!/usr/bin/sh
echo "Enter your password \c "
stty -echo
read password
stty echo
echo "you have entered the password "




Rgds
Johnson
F Verschuren
Esteemed Contributor

Re: Stop keyboard input echoing to the screen

there are manny options (depening on the script) the easy way is to redirect the screen output after the command that is reading te passwd please post your script to be more specific
>> /dev/null 2>&1

Re: Stop keyboard input echoing to the screen

Thanks johnsonpk, that did the trick..