Path: 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> <592@DIALix.oz.au> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 21 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