From owner-freebsd-questions Tue Dec 21 10: 7: 9 1999 Delivered-To: freebsd-questions@freebsd.org Received: from monsoon.mail.pipex.net (monsoon.mail.pipex.net [158.43.128.69]) by hub.freebsd.org (Postfix) with SMTP id 5AC34154B4 for ; Tue, 21 Dec 1999 10:07:00 -0800 (PST) (envelope-from mark@dogma.freebsd-uk.eu.org) Received: (qmail 25837 invoked from network); 21 Dec 1999 18:06:58 -0000 Received: from userbk65.uk.uudial.com (HELO marder-1.) (62.188.144.73) by smtp.dial.pipex.com with SMTP; 21 Dec 1999 18:06:58 -0000 Received: (from mark@localhost) by marder-1. (8.9.3/8.8.8) id SAA01032; Tue, 21 Dec 1999 18:06:53 GMT (envelope-from mark) Date: Tue, 21 Dec 1999 18:06:52 +0000 From: Mark Ovens To: Jon Hamilton Cc: Ben Smithurst , Salihin , Dan Larsson , "[FreeBSD-Questions-List] (E-post)" Subject: Re: press any key to continue in sh Message-ID: <19991221180652.A351@marder-1> References: <19991220231802.A540@strontium.scientia.demon.co.uk> <19991221024433.891113E@woodstock.monkey.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <19991221024433.891113E@woodstock.monkey.net> Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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