stty cbreak
Conor P. Cahill
cpcahil at virtech.uucp
Thu Sep 27 21:32:49 AEST 1990
In article <5985 at hplabsz.HPL.HP.COM> kjchang at hplabsz.UUCP (K. J. Chang) writes:
>I saw "A Book On C" which says I can use "stty cbreak" (pp.25) in
>UNIX so that my C program will not wait for <CR> when it reads
>"stdin".
First off:
If you are working with a C program you should not use the
stty(1) command to set the terminal characteristics. Instead use
the ioctl(2) system call with the appropriate parameters that are
defined on the termio(7) manual page.
Second:
When you do make changes to the terminal characteristics make sure
you do the following:
save the current settings
make your changes
and later, just before you exit, reset the termina to the
original settings
>I tried "stty cbreak" in sh, csh, and ksh in HP-UX (UNIX)
>and the system did not understand the command. Then, I
It won't matter what shell you use since the stty command is not a "built-in"
in any of the shells listed.
The answer to your question is to RTFM (especially the stty(1) and termio(7)
manual pages). stty -icanon should do what you want.
--
Conor P. Cahill (703)430-9247 Virtual Technologies, Inc.,
uunet!virtech!cpcahil 46030 Manekin Plaza, Suite 160
Sterling, VA 22170
More information about the Comp.unix.shell
mailing list