Wanted Dead or Alive: A ps that displays all command args...

Lenny Tropiano lenny at icus.UUCP
Tue Jun 21 04:30:45 AEST 1988


In article <2300002 at cpe> tif at cpe.UUCP writes:
|>
|>Written  6:57 pm  Jun 13, 1988 by tarkus.UUCP!jcs in cpe:comp.sources.w
|>>Has anybody got a ps program that will display the arguments that were passed
|>>to the currently running programs?  The version that came with the machine
|>>has got to go, I can't stand it anymore..  Thanks in advance.
|>
|>I thought the "-f" option to ps was standard.
|>
|>For lenny who said it can't be done:  It can be done, it's just not
|>that straight-forward.
|>
|>			Paul Chamberlain
|>			Computer Product Engineering, Tandy Corp.
|>			ihnp4!sys1!cpe!tif

Ok.  I was wrong ... It can be done.  For some reason AT&T took a short-cut
and only displayed the u_comm string in the user block that only contains
the first argument.  The real way of doing it and really the "-f"
option of the ps(1) should do this.  But as usual...

A few people mentioned the way of doing it is to look up the user's stack
space in memory and read back the arguments from the "argv-block".  Likewise
you could also print the environment (like Bezerkley BSD UNIX does)...  If
anyone cares to do this before I hack it myself, by all means.  

Of course the argv can be changed easily by a program giving you erroneous
results, the user.u_comm cannot be changed [as easily :-), I learned never
to say never]...

-Lenny
-- 
US MAIL  : Lenny Tropiano, ICUS Software Systems      IIIII  CCC U   U  SSS
           PO Box 1                                     I   C    U   U S
           Islip Terrace, New York  11752               I   C    U   U  SS 
PHONE    : (516) 968-8576 [H] (516) 582-5525 [W]        I   C    U   U    S
TELEX    : 154232428 [ICUS]                           IIIII  CCC  UUU  SSS 
AT&T MAIL: ...attmail!icus!lenny  
UUCP     : ...{talcott, boulder, pacbell, sbcs, mtune, bc-cis}!icus!lenny 



More information about the Unix-pc.general mailing list