Subject: Re: sysv ps(1) implementation [was: ps(1) sysv silliness]
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-userlevel
Date: 06/08/2000 17:31:04
[ On Thursday, June 8, 2000 at 12:40:02 (-0700), Greywolf wrote: ]
> Subject: Re: sysv ps(1) implementation [was: ps(1) sysv silliness]
>
> # I'll resuggest my original suggestion along these lines:  to introduce
> # /usr/5bin (a la SunOS 4).  This would have several benefits:
> # 
> # - selection of SysV vs. BSD semantics of a command through $PATH;
> 
> Could we not do this?  I always this was a kludge, myself.  Sun's
> /bin/sh and /bin/echo looked in $PATH to see which version to use.

It's actually not a kludge of any kind in my book -- it's the best
possible way to give the user all of the options in one simple and
extremely obvious way.

Note that you don't *have* to use $PATH to make the selection under this
scheme -- you can just as easily pick and choose with shell aliases,
functions, wrapper scripts, etc.  This obviously isn't easy as going all
the way, one way, but I would suggest that the group of folks who can't
decide whether they like some bit of sysV and some other bit of BSD is
much smaller than the group who've made up their mind and swing all the
way, all of the time...   ;-)

Particularly in the case of 'ps' there's no other way to guarantee the
"right" behaviour (unless you throw away the more recent BSD acceptance
of a '-' preceding your option letters).  As others have said every
attempt to do so has ended up with an orphan that's not fully compatible
with either stand-alone implementation.

I too would really like an *enhanced* SUSv2 compatible 'ps' in NetBSD,
and if there's going to be any number of similar tools that have a
non-compatible interface then I'd rather see them live in a separate bin
directory with a self-describing pathname rather than giving them unique
filenames (eg. /usr/susv2-bin/ps is better than ps-susv2) because then
you can use $PATH to select the group and you do not have to concoct a
number of custom aliases or whatever.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>