PATCH for a more-POSIX `ps', and related adventures

Albert Cahalan albert at users.sf.net
Thu Mar 25 07:35:50 PST 2004


On Thu, 2004-03-25 at 00:45, Garance A Drosihn wrote:
> At 9:54 PM -0500 3/24/04, Albert Cahalan wrote:
> >On Wed, 2004-03-24, Garance A Drosihn wrote:
> >
> >>  >You've added both "A" and "-A", right? That is, you're still 
> >>  >not using the presense/absense of a "-" to provide for separate
> >>  >BSD and UNIX switch namespaces.
> >>
> >>  Apparently I have.  'ps A' and 'ps -A' seem to do the same
> >>  thing for me.
> >
> >BTW, no real UNIX user ever uses -A. The -e option is used.
> >The -A is a bit of crud some POSIX committee dreamed up.
> 
> We already have a -e, so I can't just add that.
> 
> It shouldn't hurt us to add -A, and it'll prevent me from
> adding something else as -A at a later date...  :-)

It does hurt you, by making for greater pain or less gain
when you get around to splitting the namespaces. You'll
either drop the plain "A", or you'll keep it in spite of
having other options that do the same thing. You're running
out of letters that most people are able to type.

How about leaving it undocumented on purpose? That would
let scripts using "-A" work fine, while not encouraging use.

> >  > ... But my intention is to add the SUSv3-ish version of `-g'
> >  > fairly soon.  ... Of the FreeBSD users who responded, the
> >  > feeling has been "I'd rather have this SUSv3 option added
> >  > than stick with the null-option".
> >
> >This is not a 2-way choice.
> >
> >1. null-option for a bit of SunOS 4 script compatibility
> >2. SUSv3 "-g", plus accepting "g" alone as an alias
> >3. SUSv3 "-g", plus "g" for SunOS 4 script compatibility
> >
> >If you choose #2 now, you'll have forever lost compatibility
> >with SunOS 4.
> 
> I'll see what other FreeBSD'ers think about this.  I have
> no SunOS 4 machines to worry about, and I have never used
> "g" on Linux.  I'd rather make a clean break and just do
> what the standard says.

Problem is, you're not just adding "-g". You're adding "g".

> >  > Note that we already have a `-u' option...  I notice that
> >  > you're talking as if '-option' and 'option' are different
> >  > namespaces.  This is not true on FreeBSD.  If we have a
> >  > '-u', then we also have a 'u' which means the exact same
> >  > thing.
> >
> >Yes, I know. This is why "ps -ef" won't work for you.
> >AIX, Tru64, and Linux all split the namespaces to
> >solve this problem. Join the crowd! :-)
> 
> Again.  This is a side-project I'm doing.  I can't afford to
> devote a lot of time to `ps'.  If I try to split the namespace,
> then the task of merely rewriting the man page will take more
> time than I intend to spend on this.  ENOTIME.  (not right now,
> at least).

Suppose that CMD_ENV=bsd were the default for FreeBSD 5.
Then it would not be a terrible sin to leave the changes
undocumented for now.

I'll give you a hand with the parser if you have a recent
FreeBSD system you can show me around. The ps command has
been annoying cross-platform sysadmins for far too long.

Once you split the namespace, it gets easier to get Sun
to have their /bin/ps exec /usr/ucb/ps on a syntax error.
Then we'd be well on our way to forgetting the incompatibility.

> >Wow. Real BSD is dead. The "s" option prints signal info.
> 
> I'll add the `-s' option for sidlist.  If we later split the
> namespace, we can use a `s' option for signal info, if that is
> appropriate.

You'd be adding something ("ps s 12345") and then removing
it in favor of something else. That doesn't go over well.
Temporary hacks usually stand until the end of time.




More information about the freebsd-standards mailing list