Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Charles Richmond <cmr@iisc.com>
Subject: Re: ps bug on OSF1 4.0
Date: 2000/05/10	[thread overview]
Message-ID: <3919B7AA.F1828AE4@iisc.com> (raw)
In-Reply-To: pbitwmlvk8.fsf@srv-deu-cos11.baan.com

"Jens M. Felderhoff" wrote:
> 
> > From the man page:
> >
> >   -u ulist
> >       Displays only information about processes with the user
> > ID numbers
> > or
> >       login names specified in ulist.  The ulist argument is either a
> > list of
> >       user IDs or a list of user IDs enclosed in " " (double
> > quotes) and
> >       separated from one another by a comma or one or more spaces, or
> > both.
> >       Because of the way the shell treats spaces and tabs, you need to
> > quote
> >       space-separated lists.
> >
> >       In the listing, ps displays the numerical user ID unless the -f
> > option
> >       is used; then it displays the login name.
> >
> > Thus when the "-f" precedes the "-u" the id# must be changed to the
> > logname.
> 
> The description refers to the output of the listing, i.e., without the
> -f option you will get numerical UIDs and with the -f option you will
> get the login name.
> 
> However, there is no mention that the order of options is relevant! I
> checked that you may use either -f or -u first on other XPG4 compliant
> Unixes, e.g., Solaris 2.6, HP-UX 10.20, or AIX 4.3.
> 

Except that the above is not really accurate. On Solaris 2.6 and 2.7
as well as Tru64 4.0b, 4.0d, and 5.0 the output does not change between
logname and id. See below for the Solaris 2.7 example. 

SunOS hibana 5.7 Generic_106541-09
$ ps -u 1001 -f
     UID   PID  PPID  C    STIME TTY      TIME CMD
     cmr   350   347  0   Mar 28 pts/2    0:00 -ksh -c  ...

$ ps -u cmr -f
     UID   PID  PPID  C    STIME TTY      TIME CMD
     cmr   350   347  0   Mar 28 pts/2    0:00 -ksh -c  ...

There are clearly man page errors along with behavior and order
weirdnesses. 
The fact that the code only complains about ''ps: cannot find user:
"200"'' 
when the -f is parsed prior to the -u is annoying but not the end of the 
world (-;. The tru64 ps cmd is to be admired for combining the bsd and
the 
posix variants in one binary by just using the `-`. That convenience
makes 
up for some order dependence issues. On the otherhand, they really
should f
ix the man page to accurately reflect the behavior of the command. 


Usage: 
ps [-Aedamjflr] [-oO format] [-t tlist] [-p plist] [-u ulist] [-U ulist]
[-g glist] [-G glist] [-s slist] [-n nlist]
                -or-
Usage:  For BSD Compatible Syntax
ps [aexgmlvusjrSUALwhT] [Oo format] [ttty] [process number]

Charlie

-- 
***********************************************************************
*  Charles Richmond    Integrated International Systems Corporation   *
*  cmr@iisc.com           cmr@acm.org        cmr@shore.net            *
*  UNIX Internals, I18N, L10N, X, Realtime Imaging, and  Custom S/W   *
*  One Longfellow Place Suite 3309 , Boston , Ma. USA 02114-2431      *
*  (617) 723 7695   FAX (617) 723 6861   Cellular (617) 504 3379      *
***********************************************************************



      reply	other threads:[~2000-05-10  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-09  4:00 ps bug on OSF1 4.0 Jens M. Felderhoff
2000-05-10  4:00 ` Charles Richmond
2000-05-10  4:00   ` Jens M. Felderhoff
2000-05-10  4:00     ` Charles Richmond [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox