diff -r1.15 local.tcl
561,563c561,602
< #d_sum Return the output of Unix command ps -ef as a list
< #d_desc Execute the ps -ef command and return the output as a list, with \
< each line of output as an element of the list. Returns an empty string \
---
> #d_sum Return the process information from the Unix ps command
> #d_desc Determine the possible forms of the "ps" command for the current \
> operating system, then execute using the get_process_list command to \
> return the output as a list (with each line of output as an element of \
> the list). Returns an empty string on error.
>   # Determine the possible ps commands for this system
>   global tcl_platform
>   # Ideally I would prefer to put the tcl_platform(os) value into
>   # e.g. the "system" array, cf system(OPSYS) for tcl_platform(platform) 
>   # But this is the only place at present that the o/s name is required
>   # so this should be sufficient for the time being
>   if { $tcl_platform(os) == "Darwin" } {
>     # MacOs (Darwin) ps command
>     set cmd_list [list "|ps lax"]
>   } elseif { $tcl_platform(os) == "SunOS" } {
>     # SunOS ps command(s)
>     # Depends whether you are using BSD ps or not
>     set cmd_list [list "|ps -ef" "|ps lax"]
>   } else {
>     # Default
>     set cmd_list [list "|ps -ef"]
>   }
>   # Call get_process_list for each possible command
>   # Stop when you find one that works - or run out of possibilities
>   foreach ps_command $cmd_list {
>     set process_list [get_process_list $ps_command]
>     if { $process_list != "" } {
>       # Got a non-blank list of process info - return
>       return $process_list
>     }
>   }
>   # All commands failed
>   return ""
> }
> 
> #-------------------------------------------------------------
> proc get_process_list { ps_command } {
> #-------------------------------------------------------------
> #d_sum Execute and return the output of Unix command ps ...
> #d_desc Internal command called from GetProcessList. Executes the \
> supplied "ps" command and returns the output as a list, with each \
> line of output as an element of the list. Returns an empty string \
565c604,607
<   if [catch {set input [open "|ps -ef" r]
---
> #d_arg ps_command The ps ... command appropriate to this system \
> (normally ps -ef)
>   # Try to execute the process list command
>   if [catch {set input [open "$ps_command" r]
568c610
<     return ""
---
>      return ""

