--- Begin Message ---
    Date:        Wed, 17 Apr 2019 11:51:17 -0400
    From:        Chet Ramey <chet.ra...@case.edu>
    Message-ID:  <ec013fee-9397-651c-62aa-22d85802c...@case.edu>

  | But that's not what I'm claiming. I'm observing that the behavior you
  | cited from the historical Bourne shell, the option you said Geoff forgot,
  | is not present in either of the reference implementations. As such, it
  | doesn't much matter, and isn't what the standard is suggesting is
  | conformant.

Oh, I see I am (as usual) apparently not being very clear.

My position is that the standard says nothing at all about what
should be output for a trap that was ignored in a non-interactive
shell at startup, when the "trap" command is given later.

That is, any of the three outputs that we have seen is OK, the
modern bash version, the ash (and ancient Bourne shell version, with
the formatting corrected anyway) or the ksh88/solaris10 (SYSVR4.2)
(ad mksh, etc) shell's forms.

That's actually reasonable, if we accept that the point of the trap
command is to allow the trap state to be saved, so it can be restored
(which is the example that the standard does give.)   In that case,
if a signal was ignored on entry to the shell, then it is still ignored
when we to the
        eval "$saved_traps"
command that uses the output of an earlier
        saved_traps=$(trap)

In that case it doesn't matter what saved_traps contains about the ignored
signal (including nothing) since the signal will remain ignored anyway.

The fanciful interlude that we had about long running scripts, and
checkpoints, and restarts, was really just a day dream.   The chances
of a shell script ever reliably working with a model like that (regardless
of anything related to traps) are vanishingly small - that we have to
dream up nonsense possible applications to talk about this is largely
because there are no real ones (certainly none I have ever heard of).


My objection is to the claim that the standard does actually mandate
what should be output in this case, and picks one of the three reasonable
forms to be it (which happens to be the modern bash form.)

kre


--- End Message ---

Reply via email to