bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash 4.3 no longer handles traps when reading input with read


From: konsolebox
Subject: Re: Bash 4.3 no longer handles traps when reading input with read
Date: Fri, 11 Oct 2013 14:53:09 +0800

Sorry I accidentally sent the message immediately. I use this script:

catcher() {
        echo caught.
}
set -o monitor
trap catcher SIGCHLD
for (( ;; )); do
        echo sleeping.
        sleep 2s &
        echo reading.
        read -t 5
        echo ------
        echo waiting.
        wait
done

And the trap is always called every after 5 seconds when input already
times out:

sleeping.
reading.
caught.
------
waiting.
sleeping.
reading.
caught.
------
waiting.
sleeping.
reading.
...

Cheers, konsolebox


On Fri, Oct 11, 2013 at 2:47 PM, konsolebox <address@hidden> wrote:

> Good day,
>
> It seems like starting 4.3 (beta2) bash already delays handling traps
> until read exits. Is this intended? It would be a problem if read has a
> long timeout or doesn't have a timeout at all:
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]