From owner-freebsd-questions Mon Dec 20 17:28:47 1999 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 56E8E14C0E for ; Mon, 20 Dec 1999 17:28:44 -0800 (PST) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=ben) by scientia.demon.co.uk with smtp (Exim 3.092 #1) id 120C42-0000YP-00; Mon, 20 Dec 1999 23:18:02 +0000 Date: Mon, 20 Dec 1999 23:18:02 +0000 From: Ben Smithurst To: Salihin Cc: Dan Larsson , "[FreeBSD-Questions-List] (E-post)" Subject: Re: press any key to continue in sh Message-ID: <19991220231802.A540@strontium.scientia.demon.co.uk> References: <19991220201936.B1558@strontium.scientia.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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