Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Dec 1999 18:06:52 +0000
From:      Mark Ovens <mark@ukug.uk.freebsd.org>
To:        Jon Hamilton <hamilton@pobox.com>
Cc:        Ben Smithurst <ben@scientia.demon.co.uk>, Salihin <odhienx@arwana.untan.ac.id>, Dan Larsson <dl@tyfon.net>, "[FreeBSD-Questions-List] (E-post)" <freebsd-questions@freebsd.org>
Subject:   Re: press any key to continue in sh
Message-ID:  <19991221180652.A351@marder-1>
In-Reply-To: <19991221024433.891113E@woodstock.monkey.net>
References:  <19991220231802.A540@strontium.scientia.demon.co.uk> <19991221024433.891113E@woodstock.monkey.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Dec 20, 1999 at 08:44:33PM -0600, Jon Hamilton wrote:
> 
> 
> Well, this will be a little lower overhead and is more shell-ish:
> 
> #!/bin/sh
> 
> echon() {
>   if [ -n "`echo -n`" ] ; then
>     echo "$@\c"
>   else
>     echo -n "$@"
>   fi
> }
> 
> echon "Press any key to continue: "
> TTYSTATE=`stty -g`
> stty raw
> dd if=/dev/tty of=/dev/null bs=1 count=1 > /dev/null 2>&1
> stty "$TTYSTATE"
> echo
> 

I wasn't the original poster, but, thanks for the info. I knew that to
make the ubiquitous (or should that be infamous?)"any" key work
without having to also press RETURN required flipping the tty into raw
mode but couldn't figure out how to do it.



> It's only good for interactive use, which may be ok given its nature :)
> 
> -- 
>    Jon Hamilton  
>    hamilton@pobox.com
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

-- 
	"there's a long-standing bug relating to the x86 architecture
	that allows you to install Windows too  ;"
				   -Matthew D. Fuller
________________________________________________________________
      FreeBSD - The Power To Serve http://www.freebsd.org
      My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:mark@ukug.uk.freebsd.org              http://www.radan.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991221180652.A351>