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

Harti Brandt brandt at fokus.fraunhofer.de
Sun Mar 28 08:47:24 PST 2004


On Sun, 28 Mar 2004, Stephen McKay wrote:

SM>On Saturday, 27th March 2004, Garance A Drosihn wrote:
SM>
SM>>>$ PERSONALITY=freebsd ps -?
SM>>
SM>>Secondly, I personally am not fond of commands which COMPLETELY
SM>>change their behavior based on environment variables.  Different
SM>>options, different formats, different rules.
SM>
SM>Unifying ps on all Unices (including FreeBSD) is an excellent idea, and
SM>I fully support this.
SM>
SM>Using an environment variable (no matter what name is used) to switch
SM>between radically different personalities is an appalling idea.  No script
SM>can depend on the output of ps thereafter.

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.

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

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 beeing desirable.

harti


More information about the freebsd-arch mailing list