Skip site navigation (1)Skip section navigation (2)
Date:      26 Mar 2004 15:51:11 -0500
From:      Albert Cahalan <albert@users.sf.net>
To:        arch@freebsd.org
Cc:        cyrille.lefevre@laposte.net
Subject:   posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin)
Message-ID:  <1080334271.2255.1301.camel@cube>

next in thread | raw e-mail | index | archive | help
Cyrille Lefevre writes:

> two years ago, I've added posix syntax and so to my locally ps(1).
> for instance, I'm currently adding the notion of dynamic personalities

OK, would YOU be interested in working with me on some sort of
common ps specification beyond what SUSv3 has to offer? I'd love
to see something that Sun could adopt, and that could be mostly
merged into the next revision of the standard.

> (the term comes from linux) instead of static #define such as... say :
>
> $ ps -X help
> any bsd bsd43reno bsd44 default extended freebsd hpux irix netbsd none openbsd
> pedantic posix relaxed solaris sunos susv3 tru64

So you use "-X" as an escape into long options? Why not "--help"?

> personalities enable options such as :
> bsd ps :
>     -g and -n from sunos, -s from tru64 and some other options.
> posix ps : see susv3 man (see
> http://www.opengroup.org/onlinepubs/007904975/toc.htm)
>     -j from all except posix
>     -c, -y and -P from solaris
>     -C cmdlist (ala pgrep :) and -x from hpux

That "-x" will hurt you. Without it, it is easy for a SUSv3 parser
to detect the common old "ps -ax" syntax.

BTW, I have a regression test suite that you might find useful.

>     -M from irix

Do you have documentation or examples for this?

>     and some others
> they also enable many keywords such as :
>     RUSAGE and co from tru64, class and psr from solaris, and many others
> (mostly aliases)
>
> when finished, I'll probably submit these changes as a port in the meantime
> since I suppose -arch will reject these important changes to a native command.
> the most important and not done part is... the manual page. any volonteers ?

Step 1:

a. ps does old BSD behavior by default
b. /posix/bin/ps is a script that sets the SUSv3 personality
c. /usr/ucb/ps is a link to /bin/ps

Step 2:

a. ps does SUSv3 by default
b. /posix/bin/ps is a link to /bin/ps
c. /usr/ucb/ps is a script that sets the old BSD personality

> $ PERSONALITY=susv3,+extended ps -?
> usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist]
>           [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist]
>           [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist]
>        ps -o help
>        ps -X help

What syntax do you use for PERSONALITY settings? Let's do
something compatible.

The name isn't so good. Tru64 uses CMD_ENV for this, affecting
more than just ps. I made PS_PERSONALITY take priority so that
you could change ps behavior without changing other behaviors.

You forgot the "-F" from DYNIX/ptx. It's really nice.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1080334271.2255.1301.camel>