[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "wait" loses signals
From: |
Harald van Dijk |
Subject: |
Re: "wait" loses signals |
Date: |
Fri, 21 Feb 2020 00:15:07 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Thunderbird/73.0 |
On 20/02/2020 15:55, Robert Elz wrote:
Date: Thu, 20 Feb 2020 09:16:05 +0000
From: Harald van Dijk <harald@gigawatt.nl>
Message-ID: <ab007cd0-d98a-1faa-4765-2399f5df74db@gigawatt.nl>
| In that case, I think we can interpret the "when" in the description
| of the trap command literally except when 2.11 overrides it.
I think it should be interpreted just like its normal English usage,
as in:
when I win the lottery I am going to buy a Ferrari
or
I am going to buy a Ferrari when I win the lottery
(which both say the same thing).
These are both ambiguous statements. The meaning of both depends on
context and emphasis, and because context and emphasis are missing in a
standalone written sentence, we are left to infer it. The word order may
lead to a different inference for the two sentences.
It doesn't mean that the instant the lottery winnings arrive (tomorrow
please!) I will be at the luxury imported car dealers, rather it states
a pre-cpndition which will trigger an event which is to follow, sometime,
thereafter.
I can see at least three different meanings.
A: Jake bought a Porsche when he won the lottery.
When I win the lottery, I am going to buy a Ferrari. [if/after]
A: What are you going to do when you win the lottery?
B: When I win the lottery, I am going to buy a Ferrari. [as soon as]
A: How come you have five Ferraris in your garage?
B: When I win the lottery, I am going to buy a Ferrari. [whenever;
said by someone who has already won the lottery five times]
Thus
When one of the correspomding conditions arrises (standards
speak for "when a signal has been delivered") the argument
action shall be read and executed...
is "sometime after a signal has been delvered, run the trap action".
Based on how the word is used elsewhere in the standard, I think the "as
soon as" meaning is more likely here. Two random examples elsewhere from
the standard:
File Read, Write, and Creation
When a file that does not exist is created, [...]
1. The user ID of the file shall be set to the effective user ID of the calling
process.
It would be absurd to claim that the user ID might be initially set to
some completely unrelated user ID, and then changed to the effective
user ID of the calling process some time later.
2.5.1 Positional Parameters
[...] Positional parameters are initially assigned when the shell is invoked
(see sh), [...]
It would be equally absurd to claim that this allows
sh -c 'echo $1' - hello
to print a blank line because the initial assignment of the positional
parameters may happen after the first expansion of $1.
In the same way, I think that except when overridden by 2.11, the "when"
in "Otherwise, the argument action shall be read and executed by the
shell when one of the corresponding conditions arises." should be
interpreted as "as soon as".
Cheers,
Harald van Dijk
- "wait" loses signals, Denys Vlasenko, 2020/02/19
- Re: "wait" loses signals, Chet Ramey, 2020/02/19
- Re: "wait" loses signals, Denys Vlasenko, 2020/02/20
- Re: "wait" loses signals, Robert Elz, 2020/02/24
- Re: "wait" loses signals, Denys Vlasenko, 2020/02/24
- Re: "wait" loses signals, Robert Elz, 2020/02/24
- Re: "wait" loses signals, Daniel Colascione, 2020/02/24
- Re: "wait" loses signals, Chet Ramey, 2020/02/24