Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
`jobs -p` does not behave as documented and required by POSIX
- X-seq: zsh-workers 42147
- From: Matthias Richerzhagen <matthias.richerzhagen@xxxxxxxxxxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: `jobs -p` does not behave as documented and required by POSIX
- Date: Wed, 20 Dec 2017 08:56:20 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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