🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1597

Re: Implementing a Timeout During Shell Script Data Entry

#1597
From: Dan_Jacobson
Date: Tue, 23 Oct 1990 23:53
22 lines
1207 bytes
>>>>> On 22 Oct 90 14:51:29 GMT, bernie@DIALix.oz.au (Bernd Felsche) said:

Bernd> The following seems to work for me:
[...]

Well, I just stuck this in the middle of my .profile this morning...
seems to work:

test -n "$program" &&
	sec=8 &&
	trap 'trap 2' 2 &&
	echo "you got $sec seconds to interrupt before
		\"$program\"... \c" &&
	sleep $sec &&
	trap 2 &&
	eval $program

Bernd> Hope that does the trick.
I hope so too... even though there might be tiny intervals where an
interrupt would spoil the fun.
-- 
Dan_Jacobson@ATT.COM  Naperville IL USA  +1 708-979-6364
Technical Details
Message-ID: <1990Oct23.235347.20171@cbnewse.att.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!emory!att!cbnewse!danj1
References: <4128@kitty.UUCP>nSender: Bernd Felsche <592@DIALix.oz.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!emory!att!cbnewse!danj1
From: Dan_Jacobson@ATT.COM
Newsgroups: comp.unix.shell
Subject: Re: Implementing a Timeout During Shell Script Data Entry
Message-ID: <1990Oct23.235347.20171@cbnewse.att.com>
Date: 23 Oct 90 23:53:47 GMT
References: <4128@kitty.UUCP>nSender: Bernd Felsche <592@DIALix.oz.au>
Sender: danj1@cbnewse.att.com (Dan Jacobson)
Reply-To: danj1@ihlpa.att.com
Organization: AT&T-BL, Naperville IL, USA
Lines: 22
In-Reply-To: bernie@DIALix.oz.au's message of 22 Oct 90 14:51:29 GMT