On 3/28/06, Sascha Lucas <[EMAIL PROTECTED]> wrote:
> Hi List,
>
> I have a shell script and want a uninterruptable sleep. /usr/bin/sleep
> itself seems to have its own signal handlers. How is it possible to sleep
> uninterruptable?

trap "echo 'Ctrl+C should not work'" INT
now=`date +%s`
expires=$(( $now + 10 ))
while test $now -lt $expires; do
    sleep $(( $expires - $now ))
    now=`date +%s`
done

-Richard

-- 
gentoo-user@gentoo.org mailing list

Reply via email to