Project

General

Profile

Bug #6517

ps(1) does not split formats specified by -o on commas or spaces

Added by Lauri Tirkkonen almost 5 years ago. Updated over 3 years ago.

Status:
Feedback
Priority:
Normal
Category:
-
Start date:
2015-12-16
Due date:
% Done:

80%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

% ps -o vsz=,rss= -p $$
,rss=
 5232
% ps -o 'vsz= rss=' -p $$
 rss=
 5232
% ps -o 'vsz=a rss=b' -p $$
a rss=b
   5232

Using multiple -o options works properly, which is interesting because according to the manpage those are interpreted as a single space-separated concatenation of the option values:

% ps -o vsz= -o rss= -p $$
5232 3432

POSIX reference at http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html

#1

Updated by David Höppner almost 5 years ago

  • Status changed from New to In Progress
  • Assignee set to David Höppner
  • % Done changed from 0 to 80
#2

Updated by Yuri Pankov over 3 years ago

  • Status changed from In Progress to Feedback

Actually, the opengroup text has the following in "APPLICATION USAGE" section:

There is no special quoting mechanism for header text. The header text is the rest of the argument. If multiple header changes are needed, multiple -o options can be used, such as:

ps -o "user=User Name" -o pid=Process\ ID

So what we have now seems to be correct.

Also available in: Atom PDF