Bug 203744 - pgrep: -d outputs delimiter as terminator
Summary: pgrep: -d outputs delimiter as terminator
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Lawrence Stewart
URL: https://reviews.freebsd.org/D8537
Depends on:
Reported: 2015-10-13 16:42 UTC by chneukirchen
Modified: 2018-09-22 10:16 UTC (History)
2 users (show)

See Also:
koobs: mfc-stable11+

Patch ported from OpenBSD (2.06 KB, patch)
2015-10-13 16:42 UTC, chneukirchen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chneukirchen 2015-10-13 16:42:35 UTC
Created attachment 161986 [details]
Patch ported from OpenBSD

The -d flag of pgrep is supposed to "Specify a delimiter to be printed between each process ID."

Instead, the delimiter is also outputted after the final PID, where a newline should be printed instead:

% pgrep -d, tty
932,931,930,929,928,927,926,925,% _

Contrast with Linux procps-ng 3.3.11, Solaris 5.11 or OpenBSD 5.7:

% pgrep -d, tty
% _

Fixed in OpenBSD pkill.c,v 1.8 from 2005/02/11, ported patch against HEAD attached.
Comment 1 Yuri Pankov 2018-09-22 10:01:03 UTC
Fixed in base r322210.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2018-09-22 10:16:37 UTC
MFC'd to stable/11 in base r330324 by eadler 

Assign to committer that resolved