This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ps output format


On Wed, Oct 18, 2000 at 10:45:58PM -0500, Chris Abbey wrote:
>At 23:23 10/18/00 -0400, Christopher Faylor wrote:
>>I don't see much difficulty in parsing the output now, actually.
>
>true, once you know what you're doing... I've seen a lot of people
>write scripts that would have choked on that output you had above,
>simply because they saw formatted output and started making assumptions,
>where as if they'd seen colon separated values.. well cut -d ':' would
>become a much more heavily used script construct. Often picking up those
>scripts and moving them between *nix platforms has been a royal pain
>in the past, not only do you have to deal with the myriad of conflicting
>command line options, and the different ordering, but also that sometimes
>a field is 4 chars, and others it could be 10. This could *all* be solved
>if there was ONE switch across all ps implementations that output a simple
>csv style out put that could be accessed with a simple hlookup style of
>argument. ok, so I'm off in left field smoking crack and picking daises...

It's not a bad idea, but I doubt that anyone would adopt Cygwin's
convention if we adopted one.  :-)

Our insight debugger product goes to great lengths to attempt to parse
ps output on various platforms and of course it breaks every time there
is a new OS upgrade.

Cygwin's PS output is really easily parsable using awk, I think --
except for the date.  The date/time field is where there are always
problems.

If you are aware of an existing ps implementation that does this,
though, I wouldn't mind a patch to have ps emulate it.  The ps code is
really pretty simple so it should not be hard to modify.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]