Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbfsb!danj1 From: Dan_Jacobson@ATT.COM Newsgroups: comp.unix.shell Subject: Re: How to do non-blocked I/O? Message-ID: <1991Jun12.015942.27003@cbfsb.att.com> Date: 12 Jun 91 01:59:42 GMT References: <1991Jun5.114741.8167@aucs.AcadiaU.ca> <1991Jun10.021626.27188@cbnewse.att.com> Sender: news@cbfsb.att.com Reply-To: Dan_Jacobson@ihlpz.ATT.COM Organization: AT&T-BL, Naperville IL, USA Lines: 24 Originator: danj1@cbnewsf.cb.att.com >>>>> "Peter" == Peter Steele writes: Peter> I want to modify our system startup scripts to ask a question like Peter> Okay to bring up databases (y/n)? Peter> and if there is no reply within, say 5 seconds, assume "y". Can Peter> I do this from sh or csh Most major dudes [<- Steely Dan musical reference there] frown upon csh, so that leaves sh. This works in ksh & sh, so it probably works in bash too (note SYS Vish "\c" for echo though... no big deal) #just examples program="screen -r || screen" #maybe set this in a case statement 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