1 |
Hi, |
2 |
|
3 |
On Tue, 28 Mar 2006, Richard Fish wrote: |
4 |
|
5 |
> On 3/28/06, Sascha Lucas <sascha.lucas@×××××××××××××××××.de> wrote: |
6 |
>> I have a shell script and want a uninterruptable sleep. /usr/bin/sleep |
7 |
>> itself seems to have its own signal handlers. How is it possible to sleep |
8 |
>> uninterruptable? |
9 |
> |
10 |
> trap "echo 'Ctrl+C should not work'" INT |
11 |
> now=`date +%s` |
12 |
> expires=$(( $now + 10 )) |
13 |
> while test $now -lt $expires; do |
14 |
> sleep $(( $expires - $now )) |
15 |
> now=`date +%s` |
16 |
> done |
17 |
|
18 |
excellent! take system time and loop sleep until time is over. |
19 |
|
20 |
Thanks, |
21 |
|
22 |
Sascha. |
23 |
-- |
24 |
gentoo-user@g.o mailing list |