* ps bug on OSF1 4.0 @ 2000-05-09 4:00 Jens M. Felderhoff 2000-05-10 4:00 ` Charles Richmond 0 siblings, 1 reply; 4+ messages in thread From: Jens M. Felderhoff @ 2000-05-09 4:00 UTC (permalink / raw) There is a strange behavior with the ps utility on OSF1 alpha V4.0. Lets have a look: $ uname -a OSF1 alpha V4.0 878 alpha alpha $ ps -f -u 384 ps: cannot find user: "384" $ ps -u 384 -f UID PID PPID C STIME TTY TIME CMD jmfelder 7149 17954 0.0 16:56:38 ttyp0 0:00.42 -ksh (ksh) Obviously there is a bug as the position of the options is relevant although it shouldn't. Does anybody know about a patch for ps? Cheers Jens -- Jens M. Felderhoff -- Baan Company, BaanWise Workflow office: jmfelder@baan.com home : j.m.f@netcologne.de ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ps bug on OSF1 4.0 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 0 siblings, 1 reply; 4+ messages in thread From: Charles Richmond @ 2000-05-10 4:00 UTC (permalink / raw) 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. ps -f -u LOGNAME is the same as ps -u ID -f The behavior is the same on V4.0 564 alpha and on V5.0 910 alpha. > ps -f -u cmr UID PID PPID C STIME TTY TIME CMD cmr 1294 1286 0.6 May 05 ttyp1 0:01.59 -sh (sh) cmr 1300 1294 0.0 May 05 ttyp1 01:59:48 dxmail cmr 1301 1294 0.0 May 05 ttyp1 0:24.57 xmille .... > ps -u 200 -f UID PID PPID C STIME TTY TIME CMD cmr 1294 1286 0.0 May 05 ttyp1 0:01.56 -sh (sh) cmr 1300 1294 0.0 May 05 ttyp1 01:59:48 dxmail cmr 1301 1294 0.0 May 05 ttyp1 0:24.57 xmille "Jens M. Felderhoff" wrote: > > There is a strange behavior with the ps utility on OSF1 alpha V4.0. > > Lets have a look: > > $ uname -a > OSF1 alpha V4.0 878 alpha alpha > $ ps -f -u 384 > ps: cannot find user: "384" > $ ps -u 384 -f > UID PID PPID C STIME TTY TIME CMD > jmfelder 7149 17954 0.0 16:56:38 ttyp0 0:00.42 -ksh (ksh) > > Obviously there is a bug as the position of the options is relevant > although it shouldn't. > > Does anybody know about a patch for ps? > > Cheers > > Jens > -- > Jens M. Felderhoff -- Baan Company, BaanWise Workflow > > office: jmfelder@baan.com > home : j.m.f@netcologne.de -- *********************************************************************** * 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 * *********************************************************************** ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ps bug on OSF1 4.0 2000-05-10 4:00 ` Charles Richmond @ 2000-05-10 4:00 ` Jens M. Felderhoff 2000-05-10 4:00 ` Charles Richmond 0 siblings, 1 reply; 4+ messages in thread From: Jens M. Felderhoff @ 2000-05-10 4:00 UTC (permalink / raw) > 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. Cheers Jens -- Jens M. Felderhoff -- Baan Company, BaanWise Workflow office: jmfelder@baan.com home : j.m.f@netcologne.de ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ps bug on OSF1 4.0 2000-05-10 4:00 ` Jens M. Felderhoff @ 2000-05-10 4:00 ` Charles Richmond 0 siblings, 0 replies; 4+ messages in thread From: Charles Richmond @ 2000-05-10 4:00 UTC (permalink / raw) "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 * *********************************************************************** ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-05-10 4:00 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox