🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1595

Re: Implementing a Timeout During Shell Script Data Entry

#1595
From: Wm E. Davidsen Jr
Date: Wed, 24 Oct 1990 00:54
21 lines
1321 bytes
In article <592@DIALix.oz.au> bernie@DIALix.oz.au (Bernd Felsche) writes:

| #!/bin/sh  (or korny, if you have it)
| 
|   delay=6
|   trap 'trap 14' 14
|   echo "What is your Quest? \c"
|   (sleep $delay; kill -14 $$ 2>/dev/null)&
|   read YourQuest
|   kill $! 2>/dev/null
|   [ ! -z "$YourQuest" ] && echo "Bah. Humbug. Not interested in $YourQuest" \
|   			|| echo "You must be interested in something!"
| 
| Hope that does the trick.

  Works here under sh, not under ksh. No idea.
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me
Technical Details
Message-ID: <2155@sixhub.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!sixhub!davidsen
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!usc!zaphod.mps.ohio-state.edu!rpi!crdgw1!sixhub!davidsen
From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr)
Newsgroups: comp.unix.shell
Subject: Re: Implementing a Timeout During Shell Script Data Entry
Keywords: timeout, data entry, child process, simplest method
Message-ID: <2155@sixhub.UUCP>
Date: 24 Oct 90 00:54:45 GMT
References: <4128@kitty.UUCP> <nSender:> <Bernd> <Felsche> <592@DIALix.oz.au>
Reply-To: davidsen@sixhub.UUCP (bill davidsen)
Organization: *IX Public Access UNIX, Schenectady NY
Lines: 21