Subject: Re: ps -o field=HEADING,field2=HEADING2
To: None <tech-userlevel@NetBSD.org>
From: None <tlaronde@polynum.com>
List: tech-userlevel
Date: 09/12/2006 14:26:57
On Tue, Sep 12, 2006 at 01:58:56PM +0200, Joerg Sonnenberger wrote:
> On Mon, Sep 11, 2006 at 09:07:35PM +0200, tlaronde@polynum.com wrote:
> > The application shall ensure that the format specification is a list of
> > names presented as a single argument, <blank> or comma-separated.
> 
> I would place the emphasis on this sentence. First we split the argument
> on <blank> or commata.

Yes, but in this case the "tokens" are called "names" (a single argument
consisting of a list of names, 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.
> 
> I would expect "argument" to be the rest of the substring above.

That was my first impression, but since "argument" is defined as the
whole -o argument (see above), it is indeed the remaining of the whole
argument. If it was not, the text should say the remaining of the "name"
(token as defined in the first sentence).

The exemple may help since in the application usage, a "name" consisting
of "ppid=MOM" is put _last_ which matches Alan Barret's interpretation:

ps -o user,pid,ppid=MOM -o args

i.e. one must issue as many -o options as there are renamed fields.

This is subtle (and probably should have been avoided) but IMHO Alan
Barret got it right.

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