Operating System - HP-UX
1752271 Members
4561 Online
108786 Solutions
New Discussion юеВ

Accept input in hidden mode

 
SOLVED
Go to solution
Vicente Sanchez_3
Respected Contributor

Accept input in hidden mode

Hi all,

Perhaps it's a trivial question.

I need to accept a variable from a script and I want this accept in hidden mode.

Is it possible?

Regards, Vicente.
7 REPLIES 7
John Palmer
Honored Contributor
Solution

Re: Accept input in hidden mode

Hi,

stty -echo
read VARIABLE
stty echo

Regards,
John
John Poff
Honored Contributor

Re: Accept input in hidden mode

Hi,

Here is a thread that shows how to do it by turning off the echo and also using a trap statement to catch input such as Ctrl-C.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x8e7c3f490f4ed61190020090279cd0f9,00.html

JP
Vicente Sanchez_3
Respected Contributor

Re: Accept input in hidden mode

Hi,

It was what I neen, and I've been searching in the web, but not with the correct text.

Tanks, Vicente.
Balaji N
Honored Contributor

Re: Accept input in hidden mode

use stty. -echo to turn of echo and echo to turn it on.
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Arturo Galbiati
Esteemed Contributor

Re: Accept input in hidden mode

Hi,

stty -echo
read VARIABLE
stty echo

Regards,
Art
John Palmer
Honored Contributor

Re: Accept input in hidden mode

I wonder if Arturo used to be known as Jimmy ;-)
John Poff
Honored Contributor

Re: Accept input in hidden mode

John,

Imitation is the sincerest form of flattery. :)

JP