Date: Mon, 20 Dec 1999 23:18:02 +0000 From: Ben Smithurst <ben@scientia.demon.co.uk> To: Salihin <odhienx@arwana.untan.ac.id> Cc: 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: <19991220231802.A540@strontium.scientia.demon.co.uk> In-Reply-To: <Pine.BSF.4.10.9912200434190.2209-100000@arwana.untan.ac.id> References: <19991220201936.B1558@strontium.scientia.demon.co.uk> <Pine.BSF.4.10.9912200434190.2209-100000@arwana.untan.ac.id>
next in thread | previous in thread | raw e-mail | index | archive | help
Salihin wrote:
> On Mon, 20 Dec 1999, Ben Smithurst wrote:
>
>> Dan Larsson wrote:
>>
>>> How do I best produce a 'press any key to continue' prompt in sh?
>>
>> Try this:
>>
>> echo "Press any key to continue..."
>> perl -e 'system("stty", "cbreak"); getc(STDIN); system("stty", "-cbreak");'
>>
>
> or...
> /bin/sh -c "read -p \"Press CTRL+C to abort and ENTER to continue !\" _e"
> ^^^^^^
> shell :-)
So show me YOUR solution which implements what Dan asked for - "press
any key to continue", not "press ENTER to continue". :-)
Using perl may not be allowed, but it's the only way I can think of
offhand. Unless Dan wants it implemented using shell builtin commands,
I don't see anything wrong with my solution (higher overhead than I'd
like, but still).
--
Ben Smithurst | PGP: 0x99392F7D
ben@scientia.demon.co.uk | key available from keyservers and
| ben+pgp@scientia.demon.co.uk
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?19991220231802.A540>
