www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/30/16:48:06

From: tage DOT westlund AT stockholm DOT mail DOT telia DOT com (Tage Westlund)
Subject: Re: Another newbie Bash question
30 Oct 1997 16:48:06 -0800 :
Message-ID: <3459491B.6171.cygnus.gnu-win32@stockholm.mail.telia.com>
References: <Pine DOT HPP DOT 3 DOT 95q DOT 971030001315 DOT 26505A-100000 AT risc DOT anderson DOT ucla DOT edu>
Reply-To: tage DOT westlund AT stockholm DOT mail DOT telia DOT com
Mime-Version: 1.0
To: jmamer AT anderson DOT ucla DOT edu
Cc: gnu-win32 AT cygnus DOT com

John Mamer wrote:
> 
> #!/bin/sh
> echo -n "First variable: "
> read VAR1
> echo -n "Secnd variable: "
>
> it reads the first variable, and then skips
> through the second two reads.
> Is there some way to flush the keyboard buffer between
> reads?

To John!
There is a simple "flush":

echo -n First variable:
read VAR1; read 
echo -n Secnd variable:
read VAR2; read
echo -n Third variable:
read VAR3; read
echo "The variables were: $VAR1 $VAR2 $VAR3"

Tage

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019