posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin)

Stephen McKay smckay at internode.on.net
Sun Mar 28 16:42:12 PST 2004


On Sunday, 28th March 2004, Harti Brandt wrote:

>Well, that is just like LANG or LC_ALL. You cannot depend on parsing
>utility output until you set LC_ALL=C, yet I have still to see a script
>that does this.

Yes, that is a significant deficiency of the internationalisation scheme.
That doesn't mean we should copy it though.

>If you happen to write a script for BSD syntax just put LC_ALL=C
>PERSONALITY=BSD on top of it.

Hopefully in the near future there will be a universally accepted default
for ps options.  Are you seriously suggesting that every script forevermore
will have to put PERSONALITY=STANDARD (or similar) in front of a two
character command name just to defeat this misfeature?

>SM>If multiple personalities is a desirable trait (and it's not clear that it
>SM>is) then command line switches and aliases are the correct mechanisms to
>SM>use.
>
>That would require to add that switch to all utility calls in a script
>that have multiple personalities. Thats far from being desirable.

I don't understand.  I was suggesting that if end users want different
flavours of output they can select them with command line switches and
aliases (if this is an option at all).  This is as opposed to allowing
users to select the default via an environment variable, which would
negatively impact the use of ps in scripts.

I can't see why scripts would want to use anything but the standard options.
You only want to parse one format.

Stephen.


More information about the freebsd-arch mailing list