Date:        Sun, 19 Apr 2020 22:02:49 +0900
    From:        Koichi Murase <[email protected]>
    Message-ID:  
<caflrlk8lqxwtwuaarj5+-_t6xmoxrwyq6uxs794-v1mwrta...@mail.gmail.com>

  | Thank you for pointing out this.  After reading your comment, I was
  | interested in the behavior of the Bourne shell, so I have tried with
  | the Heirloom Bourne shell (which is a port of the SVR4 Bourne shell
  | according to its page) in AUR.  Actually, the Heirloom Bourne shell
  | turns out to follow the interpretation (A) [ although it might be
  | possible that the behavior is changed by the port ].

Probably not, bosh is derived from that shell (more or less) and it is
also A

bosh $ $SHELL /tmp/TTT
In trap argument: last command preceding the trap action
In direct function call: last command in the trap action
In indirect function call: last command in the trap action
bosh $ $SHELL -c 'echo ${.sh.version}'
version bosh 2020/04/10 a+ (amd64-unknown-netbsd8.99.30)

(it is really version 2020/04/18 without the version string being updated).

So are the FreeBSD and NetBSD shells (which is not surprising, as like
dash, they're descendants of ash).

You can also add zsh to A:

zsh $ $SHELL /tmp/TTT
In trap argument: last command preceding the trap action
In direct function call: last command in the trap action
In indirect function call: last command in the trap action
zsh $ echo $SHELL
/usr/pkg/bin/zsh
zsh $ $SHELL -c 'echo ${ZSH_VERSION}'
5.6.2

(/tmp/TTT is your script - but with a newline removed.  It might have just
been an e-mail artifact, and was in the middle of one of the messages).

  | Thank you for suggesting another possibility.  Let me call the above
  | one the interpretation (D).
  | But there was actually no implementation that follows (D)

I am not all that surprised, it would be a rather bizarre interpretation.

kre

Reply via email to