l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 7: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2002 Jun 21 07:04

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] preventing display of typed text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] preventing display of typed text?



For all UNIX scripting languages, I think using `stty` is the generic way
of turning off console echos:

   stty -echo

You can try it rigt now on the Linux console.  Anything you type won't
be echoed back to you, but you can still type commands.  Then to turn it
back on:

   stty echo

Of course, you won't see yourself typing that command, but you can still
type it and press enter to execute it.  BTW, make sure you check to make
sure the command was executed successfully first; it could otherwise be a
security problem on systems without the `stty` command.

But anyway, unfortunately that doesn't work on non-unix platforms.

You could always write a simple C program to handle non-echoing inputs.
I think getpass() C call is as universal as it gets (it's a unix call but
it's been adapted pretty widely, I hink).  Most UNIX should also support
the termios library for controlling terminal behavior (see `man termios`),
which I think is what stty uses anyway so that may be moot exercise.

-Mark


On Fri, 21 Jun 2002, Ryan wrote:

> On Thursday 20 June 2002 11:36 pm, Peter Jay Salzman wrote:
> > without checking, i've used 2 perl modules that might help:
> >
> > term which implements the advanced features that termcap provides like
> > underlining and boldfacing text
> >
> > ncurses which basically implements the C style ncurses library.
> >
> > i would imagine both modules allow you to do this.  in fact, i _know_
> > that C/ncurses has a function to block echo in raw mode.  i'm guessing
> > that perl/ncurses can do this too.
>
> I prefer a solution that is platform independant and non perl specific if
> possible, i.e., I may want to do something in bash or write a cross-platform
> perl script.
>
> --
> Breaking Windows isn't just for kids anymore...
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>

--
Mark K. Kim
http://www.cbreak.org/
PGP key available upon request.




_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.