Clearing the input buffer before a read.

USENET News System news at massey.ac.nz
Mon Nov 26 11:14:25 AEST 1990


I have an sh script that asks the user a question and reads
the answer into a variable in the usual method.  I want to
be able to flush the input buffer just before the read so
that any slips or double key bounces get ignored, rather than
used as the answer.  I realize this disables type ahead, but
I can live with that.  Anyone know how to do this?

Thanx,
-- 
Ken Spagnolo - Systems Programmer, Postmaster, Usenet Administrator, etc.
   Computer Centre, Massey University, Palmerston North, New Zealand
K.Spagnolo at massey.ac.nz  Phone: +64-63-69099 x8587  New Zealand = GMT+12



More information about the Comp.unix.shell mailing list