Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!cc-server4.massey.ac.nz!K.Spagnolo From: news@massey.ac.nz (USENET News System) Newsgroups: comp.unix.shell Subject: Clearing the input buffer before a read. Message-ID: <1990Nov26.001425.15563@massey.ac.nz> Date: 26 Nov 90 00:14:25 GMT Reply-To: K.Spagnolo@massey.ac.nz (Ken Spagnolo) Organization: Massey University Computer Centre Lines: 12 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@massey.ac.nz Phone: +64-63-69099 x8587 New Zealand = GMT+12