Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

`jobs -p` does not behave as documented and required by POSIX



Hello,

the manpage for the `jobs` buildin function states:

>       −p        Display only the process IDs for the process group
>       leaders of the selected jobs.

> STDOUT
>        If the −p option is specified, the output shall consist of one
> line for each process ID:
> 
>            "%d\n", <process ID>

From the command:

    ( sleep 5; echo 1 ) & ( sleep 10; echo 2 ) &; jobs -p

one can see, that the output does NOT only display the process IDs:

    [1]  - 9282 running    ( sleep 5; echo 1; )
    [2]  + 9283 running    ( sleep 10; echo 2; )

making the usage in commands like

    kill `jobs -p`

generate a lot of error messages.

This is with 

    $ zsh --version 
    zsh 5.4.2 (x86_64-unknown-linux-gnu)

on Arch Linux.

Greetings,
Matthias



Messages sorted by: Reverse Date, Date, Thread, Author