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.