On Fri, Feb 15, 2008 at 7:55 AM, <[EMAIL PROTECTED]> wrote:
>
>
> Currently Solaris has two distinct versions of ps; to use one or the other
> you need to either give the full path or change $PATH.
>
> And that while a little bit of code could tell most invocations apart.
>
> Because it has been bothering me I'd like to fix this and so I'd like to
> ask some advice.
>
> Merging the code in a simple fashion (renaming main ucbmain/stdmain and
> calling one other the other) is straight forward enough but I'm not sure
> how useful it is.
>
> The simple plan is this:
>
> - if called with an argument which does not start with "-",
> be /usr/ucb/ps
> - if called with an argument starting with "-" behave like ucb ps
> or bin/ps depending on how the program was invoked
>
> Solaris /usr/ucb/ps also has at least one compatibility issue I might want
> to fix:
>
> /usr/ucb/ps wwwwPPPPPP
>
> where "P" is a pid does not work; you need to supply a space between the
> <pid> and the other arguments. (An issue when you've just migrated)
That sounds right to me.
> Now that we but "ucb" ps code in standard ps, should we also allow
> for long arguments list in normal ps as ucb/ps allows?
I think so.
> (Note that neither ps is set-uid at this time and that you can only see
> the environment variables and long arguments of your own processes)
I think that the version of ps found on GNU/Linux environments
provides some interesting points of comparison.
>From the man page:
This version of ps accepts several kinds of options.
Unix98 options may be grouped and must be preceeded by a dash.
BSD options may be grouped and must not be used with a dash.
GNU long options are preceeded by two dashes.
Options of different types may be freely mixed.
Set the I_WANT_A_BROKEN_PS environment variable to force BSD syntax
even when options are preceeded by a dash. The PS_PERSONALITY environ-
ment variable (described below) provides more detailed control of ps
behavior.
...
ENVIRONMENT VARIABLES
The following environment variables could affect ps:
COLUMNS Override default display width
LINES Override default display height
PS_PERSONALITY Set to one of posix,old,linux,bsd,sun,digital
CMD_ENV Set to one of posix,old,linux,bsd,sun,digital
I_WANT_A_BROKEN_PS Force obsolete command line interpretation
LC_TIME Date format
PS_FORMAT Default output format override
PS_SYSMAP Default namelist (System.map) location
PS_SYSTEM_MAP Default namelist (System.map) location
POSIXLY_CORRECT Don't find excuses to ignore bad "features"
UNIX95 Don't find excuses to ignore bad "features"
_XPG Cancel CMD_ENV=irix non-standard behavior
In general, it is a bad idea to set these variables. The two exceptions
are CMD_ENV (or PS_PERSONALITY), to set the desired default personal-
ity, and POSIXLY_CORRECT (or UNIX95), which should be set for Unix98
standard compliance.
PS_PERSONALITY Description
()
()
none "Do the right thing"
aix like AIX ps
bsd like FreeBSD ps
compaq like Digital Unix ps
debian like the old Debian ps
digital like Digital Unix ps
gnu like the old Debian ps
hp like HP-UX ps
hpux like HP-UX ps
irix like Irix ps
linux deviate from Unix98 for convenience only
old like the original Linux ps
posix standard
sco like SCO ps
sgi like Irix ps
sun like SunOS 4 ps
sunos like SunOS 4 ps
sysv standard
unix standard
unix95 standard
unix98 standard
...
Just thought I'd note this,
--
Shawn Walker, Software and Systems Analyst
http://binarycrusader.blogspot.com/
"To err is human -- and to blame it on a computer is even more so." -
Robert Orben
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code