DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Creating an SCO Visual Tcl program -- an overview

Displaying the process list (GetPsList)

  proc GetPsList {} {

set psOut [exec /bin/ps -u [id user] -o pid -o comm]

set psOut [split $psOut "\n"]

lvarpop psOut

return $psOut }

The GetPSList procedure:

  1. runs a ps on the current user, using the exec(TCL) command, then stores the list in the variable psOut

  2. puts the results in a readable list using split(TCL)

  3. strips the header from the list using lvarpop(TCL) to pop the title off the top of the list

  4. returns the list

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005