reading without echoing to the screen

reading without echoing to the screen

Post by DFRusse » Thu, 13 Oct 1994 23:03:33



stty echo

stty -echo


|> I got such fantastic responce on my last dumb question, I decided to turn
|> this one over to you as well! :)  Here's another stumper for you all:
|>
|> How would one read a word typed by a user without echoing it to the
|> screen (it's a password).  In my sh script I currently have:
|>
|> #!/bin/sh
|>
|>           {stuff deleted}
|>
|> echo "Special system user name:"
|> echo $ssusername
|>
|> echo "Enter password:"
|> read $sspassword
|>
|> export $ssusername $sspassword
|>
|> newscript &
|>                          
|>
|>                           Thanks, Simon...
|> --
|> ||| | || || Generic Sig                                           ''`
|> ||| | || || ===========                                           O-O
|> ||| | || ||                                                        L

|> || 01416 || Information Technology Dept, Sheridan College, Oakville, ON, Canada

--
Disclaimer: I don't speak for Martin Marietta or the EPA.
----------------------------------------------------------

P.O. Box 14365, MD-4501-1B, Research Triangle Park, NC 27709  

 
 
 

reading without echoing to the screen

Post by Simon Galt » Thu, 13 Oct 1994 06:11:21


I got such fantastic responce on my last dumb question, I decided to turn
this one over to you as well! :)  Here's another stumper for you all:

How would one read a word typed by a user without echoing it to the
screen (it's a password).  In my sh script I currently have:

#!/bin/sh

                {stuff deleted}

echo "Special system user name:"
echo $ssusername

echo "Enter password:"
read $sspassword

export $ssusername $sspassword

newscript &

                                Thanks, Simon...
--
||| | || || Generic Sig                                         ''`
||| | || || ===========                                         O-O
||| | || ||                                                      L

|| 01416 || Information Technology Dept, Sheridan College, Oakville, ON, Canada

 
 
 

reading without echoing to the screen

Post by Yagne » Thu, 13 Oct 1994 23:17:01



>How would one read a word typed by a user without echoing it to the
>screen (it's a password).  In my sh script I currently have:
>#!/bin/sh
>            {stuff deleted}
>echo "Special system user name:"
>echo $ssusername

>echo "Enter password:"
>read $sspassword

>export $ssusername $sspassword

>newscript &

echo "Special system user name:"
echo $ssusername

echo "Enter password:"
stty -echo
read $sspassword
stty echo

export $ssusername $sspassword

newscript &

--

REN Corporation USA                     | (615) 353-4145

 
 
 

reading without echoing to the screen

Post by Braa » Thu, 13 Oct 1994 16:23:56



>I got such fantastic responce on my last dumb question, I decided to turn
>this one over to you as well! :)  Here's another stumper for you all:
>How would one read a word typed by a user without echoing it to the
>screen (it's a password).  In my sh script I currently have:
>#!/bin/sh
>            {stuff deleted}
>echo "Special system user name:"
>echo $ssusername
>echo "Enter password:"
>read $sspassword
>export $ssusername $sspassword
>newscript &

Try the following:
  echo "Enter password:"
  stty -echo
  read password
  stty echo
  echo

Quote:>                            Thanks, Simon...

Greetings, Knut.
>--
>||| | || || Generic Sig                                             ''`
>||| | || || ===========                                             O-O
>||| | || ||                                                  L

>|| 01416 || Information Technology Dept, Sheridan College, Oakville, ON, Canada

 
 
 

1. reading without echoing to the screen

You can use the stty command:

#!/bin/sh

TERM=vt100                                      #<---

                {stuff deleted}

echo "Special system user name:"
echo $ssusername

echo "Enter password:"
stty-echo                                       #<---
read $sspassword
stty echo                                       #<---

export $ssusername $sspassword

newscript &

Sincerely
Reinhard Corr

2. Newbie questions

3. reading in from keyboard input without echoing to the screen

4. securing a resource, access from a remote server

5. Reading Input without echoing chars

6. Performance of Solaris 2.5, wabi for i86

7. Read without echo'ing

8. Kernel problems

9. How to read a line without echo from a shell script?

10. How can I read without echoing?

11. Reading from stdin without RETURN and echo

12. Reading input without echo

13. line by line without using echo "$i" | while read line?