ps -c num bug or feature ?

Jonathan I. Kamens jik at athena.mit.edu
Mon Jan 15 20:43:39 AEST 1990


In article <1072 at dutrun.UUCP>, hans at duttnph.tudelft.nl (Hans Buurman) writes:
> 
> I don't understand the following behaviour of ps (SunOs 4.0.1):
> 
> hans55> ps -c 23706
> ps: cannot open 23706: No such file or directory
> 
> This should be correct according to the manual, I think.
> From the SunOS manual:
> 
>      num  A process number may be given, in which case the output
>           is  restricted  to that process.  This option must also
>           be last.

  The manual also says (at the top):

     SYNOPSIS
          ps [ acegklnstuvwxU# ]

This means that the pid number should be part of the first argument
passed to ps, not in a second argument.  In other words, you should have typed:

     ps -c23706

I'm also not convinced that the '-' is even necessary, although it
probably can't hurt.

  The error you received is due to the fact that if ps is given a second
argument, it treats that argument as the file containing the system's
namelist.  Again, from the man page:

     A second argument is taken to be the file containing the
     system's namelist.  Otherwise, /vmunix is used.  A third
     argument tells ps where to look for core if the k option is
     given, instead of /vmcore.  If a fourth argument is given,
     it is taken to be the name of a swap file to use instead of
     the default /dev/drum.

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list