Path: utzoo!attcan!uunet!munnari.oz.au!uniwa!DIALix!bernie From: bernie@DIALix.oz.au (Bernd Felsche) Newsgroups: comp.unix.shell Subject: Re: Implementing a Timeout During Shell Script Data Entry Summary: Use kill and signals Keywords: timeout, data entry, child process, simplest method Message-ID: <592@DIALix.oz.au> Date: 22 Oct 90 14:51:29 GMT References: <4128@kitty.UUCP>nSender: Bernd Felsche Reply-To: bernie@DIALix.oz.au (Bernd Felsche) Organization: DIALix Services, Perth, Western Australia Lines: 19 The following seems to work for me: #!/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. -- ________Bernd_Felsche__________bernie@DIALix.oz.au_____________ [ Phone: +61 9 419 2297 19 Coleman Road ] [ TZ: UTC-8 Calista, Western Australia 6167 ]