Page MenuHomeFreeBSD

Suppress emission of delimiter after final PID when using pgrep's -d switch
ClosedPublic

Authored by lstewart on Nov 16 2016, 9:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 31 2024, 7:25 AM
Unknown Object (File)
Jan 31 2024, 7:25 AM
Unknown Object (File)
Dec 20 2023, 7:49 AM
Unknown Object (File)
Nov 25 2023, 10:56 AM
Unknown Object (File)
Nov 25 2023, 10:52 AM
Unknown Object (File)
Nov 13 2023, 11:51 AM
Unknown Object (File)
Oct 25 2023, 6:06 AM
Unknown Object (File)
Aug 22 2023, 4:50 AM
Subscribers

Details

Summary

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.

Sponsored by: Netflix, Inc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 5962

Event Timeline

lstewart retitled this revision from to Suppress emission of delimiter after final PID when using pgrep's -d switch.
lstewart updated this object.
lstewart edited the test plan for this revision. (Show Details)
lstewart added a reviewer: kib.
lstewart set the repository for this revision to rS FreeBSD src repository - subversion.
imp added a reviewer: imp.

Lots of ways to skin this cat, this is as good as any other.

This revision is now accepted and ready to land.Nov 16 2016, 3:15 PM
kib edited edge metadata.

We have working C99 bool type.

lstewart edited edge metadata.
lstewart removed rS FreeBSD src repository - subversion as the repository for this revision.

@kib: You prefer this?

This revision now requires review to proceed.Nov 17 2016, 4:48 AM
kib edited edge metadata.

As a very minimal start, yes. You may consider changing the return type of action to bool and do the necessary cascade of related changes.

This revision is now accepted and ready to land.Nov 17 2016, 9:30 AM
This revision was automatically updated to reflect the committed changes.