From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,4babe8922898e098 X-Google-Attributes: gidfee84,public From: Charles Richmond Subject: Re: ps bug on OSF1 4.0 Date: 2000/05/10 Message-ID: <3919B7AA.F1828AE4@iisc.com>#1/1 X-Deja-AN: 621696526 Content-Transfer-Encoding: 7bit References: <3918EE60.29587A62@iisc.com> X-Accept-Language: Japanese, ja, en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@shore.net X-Trace: news.shore.net 957986824 198.5.5.16 (Wed, 10 May 2000 15:27:04 EDT) Organization: Integrated International Systems Corp. MIME-Version: 1.0 NNTP-Posting-Date: Wed, 10 May 2000 15:27:04 EDT Newsgroups: comp.unix.osf.osf1 "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 * ***********************************************************************