NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/50337: pgrep: -d outputs delimiter as terminator



>Number:         50337
>Category:       bin
>Synopsis:       pgrep: -d outputs delimiter as terminator
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 13 17:10:01 +0000 2015
>Originator:     Christian Neukirchen
>Release:        5.2.3 (also in 7.0)
>Organization:
>Environment:
NetBSD zhora 5.2.3 NetBSD 5.2.3 (XEN3_DOMU) #0: Sat Nov 15 21:06:05 UTC 2014  snj%b45.netbsd.org@localhost:/home/builds/ab/netbsd-5-2-3-RELEASE/amd64/201411152021Z-obj/home/source/ab/netbsd-5-2-3-RELEASE/src/sys/arch/amd64/compile/XEN3_DOMU amd64
>Description:
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.

Fixed in OpenBSD pkill.c,v 1.8 from 2005/02/11, ported patch below.
>How-To-Repeat:
% pgrep -d, t
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, t
3191,902
% _
>Fix:
Patch ported from OpenBSD available at http://chneukirchen.org/patches/netbsd-7.0-pkill-delim.patch

Also see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203744 for the equivalent bug in FreeBSD.



Home | Main Index | Thread Index | Old Index