Skip to content

[bug] jobs -x substitutes job PID, GNU substitutes process-group ID #1096

Closed

Description

@caomengxuan666

[bug] jobs -x substitutes the job PID, GNU substitutes the process-group ID

sleep 30 &
jp=$!
echo "jobpid=$jp pgid=$(ps -o pgid= -p $jp)"
jobs -x echo %1
# GNU bash 5.3:  jobpid=4844 pgid=4842, prints 4842 (the pgid — POSIX: jobspec → pgroup ID)
# niu:           jobpid=4880 pgid=4854, prints 4880 (the pid)

Visible consequence: sleep 2 & jobs -x kill %1; sleep 0.3; echo alive → bash kills its own pgroup-pid (self-TERM, script dies rc=143, alive never prints); niu kills only the job and continues (alive, rc=0). (Standalone %1 must be used — embedded %1 is literal in both.)

Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.

Activity

  1. added
    bug
    gnu-baseline
    area:jobs
    P2-medium
    on Oct 22, 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-mediumarea:jobsbuggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions