Created attachment 185422 [details] Print a newline before exiting After r322210 pgrep(1) no longer prints the final newline. Output: $ sleep 1 & pgrep sleep 12345$ Expected output: $ sleep 1 & pgrep sleep 12345 $
Thanks for the report. Unintended change in behaviour. Will fix.
A commit references this bug: Author: lstewart Date: Thu Aug 17 06:36:21 UTC 2017 New revision: 322613 URL: https://svnweb.freebsd.org/changeset/base/322613 Log: The r322210 change to pgrep's PID delimiting behaviour causes pgrep's default output to not include a trailing new line, which is a potential POLA violation for existing consumers. Change pgrep to always emit a trailing new line on completion of its output, regardless of the delimeter in use (which technically is also a potential POLA violation for existing consumers that rely on the pre-r322210 buggy behaviour, but a line has to be drawn somewhere). PR: 221534 Submitted by: kdrakehp zoho com Reported by: kdrakehp zoho com MFC after: 1 week X-MFC-with: r322210 Changes: head/bin/pkill/pkill.c
A commit references this bug: Author: eadler Date: Sat Mar 3 10:43:42 UTC 2018 New revision: 330324 URL: https://svnweb.freebsd.org/changeset/base/330324 Log: MFC r322210,r322613,r322831: pgrep naively appends the delimiter to all PIDs including the last e.g. "pgrep -d, getty" outputs "1399,1386,1309,1308,1307,1306,1305,1302," Ensure the list is correctly delimited by suppressing the emission of the delimiter after the final PID. The r322210 change to pgrep's PID delimiting behaviour causes pgrep's default output to not include a trailing new line, which is a potential POLA violation for existing consumers. Change pgrep to always emit a trailing new line on completion of its output, regardless of the delimeter in use (which technically is also a potential POLA violation for existing consumers that rely on the pre-r322210 buggy behaviour, but a line has to be drawn somewhere). Only emit the trailing new line added in r322613 when not operating in quiet mode. PR: 221534 (r322613) Changes: _U stable/11/ stable/11/bin/pkill/pkill.c