🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #342

Re: hiding password output

#342
From: Robert J. Stanton
Date: Wed, 05 Aug 1992 16:23
22 lines
1085 bytes
Rowan_Smith@kcbbs.gen.nz (Rowan Smith) writes:

>Can some kind soul please tell me how to read a string from the keyboard
>without echoing it to the screen ?

>Or even better how to read a single keypress in for instant processing 

>Again the single Keypress must not echo.

>AdvaTHANKSnce.
>Rowan_Smith@kcbbs.gen.nz

This should work.  If you are running SysV, e-mail me and I will
show you how to do it there.
----------------------------------

#!/bin/sh

stty cbreak -echo
readchar=`dd bs=1 count=1 2>/dev/null`
stty -cbreak echo
echo $readchar
Technical Details
Message-ID: <1992Aug5.162300.26643@msuinfo.cl.msu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!wupost!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cert!netnews.upenn.edu!msuinfo!crs.cl.msu.edu!rjs
References: <10028.2189216399@kcbbs.gen.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!wupost!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cert!netnews.upenn.edu!msuinfo!crs.cl.msu.edu!rjs
From: rjs@crs.cl.msu.edu (Robert J. Stanton)
Newsgroups: comp.unix.programmer
Subject: Re: hiding password output
Message-ID: <1992Aug5.162300.26643@msuinfo.cl.msu.edu>
Date: 5 Aug 92 16:23:00 GMT
References: <10028.2189216399@kcbbs.gen.nz>
Sender: news@msuinfo.cl.msu.edu
Organization: Michigan State University
Lines: 22