Bug 102232 - Defects in -O option to ps(1)
Summary: Defects in -O option to ps(1)
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-18 14:40 UTC by Yar Tikhiy
Modified: 2017-12-31 22:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yar Tikhiy 2006-08-18 14:40:13 UTC
	1. Multiple -O options to ps(1) result in ill-looking output.
	   Using multiple -O options can be necessary if one wants to
	   supply blank column titles for the columns added.  (Why not?)
	   Ability to supply multiple -O options to ps(1) would be consistent
	   with that for multiple -o options.

	2. Using -O along with flags changing the default columns,
	   e.g., -u, produces ill-looking output.

Fix: 

Have ps(1) construct 3 internal lists of keywords to display
	instead of the current single list: leading, user-supplied,
	and trailing.  Options like -u would switch the 1st and 3rd
	lists then.  Option -o would set the 1st and 3rd lists to
	nil once before filling the 2nd one.  Option -O would just
	fill the 2nd list.
How-To-Repeat: 
%ps -O jid -O rss
  PID    JID  TT  STAT      TIME COMMAND            RSS
  768      0  p0  Ss     0:00.64 -csh (csh)        4044
 1405      0  p0  R+     0:00.01 ps -O jid -O rss  1012
 1007      0  p1  Is     0:00.05 -csh (csh)        2944

%ps -u -O jid
USER   PID %CPU %MEM   VSZ   RSS  TT  STAT STARTED      TIME COMMAND            PID    JID  TT  STAT      TIME COMMAND
yar    768  0.0  3.5  6116  4044  p0  Ss    3:37PM   0:00.64 -csh (csh)         768      0  p0  Ss     0:00.64 -csh (csh)
yar   1406  0.0  0.9  5228  1012  p0  R+    5:19PM   0:00.01 ps -u -O jid      1406      0  p0  R+     0:00.01 ps -u -O jid
yar   1007  0.0  2.5  4744  2944  p1  Is    4:21PM   0:00.05 -csh (csh)        1007      0  p1  Is     0:00.05 -csh (csh)
Comment 1 Garance A Drosehn freebsd_committer 2006-08-21 03:31:20 UTC
Responsible Changed
From-To: freebsd-bugs->gad

.  I know what you're talking about.  I had a fix for it in one of my 
test versions of 'ps', but never got around to installing those changes 
(it was part of a much larger set of changes).  I am pretty busy for 
the next two or three weeks, but I should be able to look into this 
sometime after that.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:42 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped