Skip to content

[bug] ERR trap 在间接展开错误时被错误触发 #439

Closed

Description

@caomengxuan666

复现

trap 'echo ERR-FIRED' ERR
x=${!bad}
echo after
  • GNU bash: 打印 bad: invalid indirect expansion,不触发 ERR trap,继续执行 echo after
  • rubash/niu: 打印同样的错误后,额外触发了 ERR trap(多一行 ERR-FIRED)

注意:两者对错误信息与后续执行都一致,差异只在 trap 触发语义。

环境: Niubash v1.3.3 / rubash 646237e, Linux x86_64。

Activity

  1. added
    P2-medium
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions