Subject: Re: ps -o field=HEADING,field2=HEADING2
To: Alan Barrett <apb@cequrux.com>
From: None <tlaronde@polynum.com>
List: tech-userlevel
Date: 09/11/2006 21:07:35
On Mon, Sep 11, 2006 at 08:21:29PM +0200, Alan Barrett wrote:
> On Mon, 11 Sep 2006, Joerg Sonnenberger wrote:
> > On Mon, Sep 11, 2006 at 12:30:53AM +0200, Alan Barrett wrote:
> > > 1) SUSv2 says that {ps -o "field1=HEADING1,field2=HEADING2"} specifies
> > > only one field: field1, whose heading is "HEADING1,field2=HEADING2".
> > > NetBSD's ps thinks that it specifies two fields: field1 with heading
> > > "HEADING1", and field2 with heading "HEADING2".  I think we should
> > > change to be SUS compatible here.  Any objections?
> > 
> > I read the SUSv3 text differently. Can you recheck this and the other
> > things against v3?

FWIW, here is the v3 phrasing :

----quote
The -o option allows the output format to be specified under user
control.

The application shall ensure that the format specification is a list of
names presented as a single argument, <blank> or comma-separated. Each
variable has a default header. The default header can be overridden by
appending an equals sign and the new text of the header. The rest of the
characters in the argument shall be used as the header text. The fields
specified shall be written in the order specified on the command line,
and should be arranged in columns in the output. The field widths shall
be selected by the system to be at least as wide as the header text
(default or overridden value). If the header text is null, such as -o
user=, the field width shall be at least as wide as the default header
text. If all header text fields are null, no header line shall be
written.
----endquote

The sentence: "The rest of the characters in the argument shall be used 
as the header text." seems to correlate Alan Barret's interpretation,
since it is specified multiple times that there is a SINGLE argument.
Even if it is surprising at first (I, for one, did not interpret this
at first the same way). I'm no expert, and I'm not an english native 
speaker.

Regards,
-- 
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C