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(1tcl) command, then stores the list in the variable psOut

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

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

  4. returns the list

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004