1pid(n)                       Tcl Built-In Commands                      pid(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       pid - Retrieve process identifiers
9

SYNOPSIS

11       pid ?fileId?
12______________________________________________________________________________
13
14

DESCRIPTION

16       If  the  fileId  argument  is  given then it should normally refer to a
17       process pipeline created with the open command.  In this case  the  pid
18       command  will  return a list whose elements are the process identifiers
19       of all the processes in the pipeline, in order.  The list will be empty
20       if fileId refers to an open file that is not a process pipeline.  If no
21       fileId argument is given then pid returns the process identifier of the
22       current  process.   All  process  identifiers  are  returned as decimal
23       strings.
24

EXAMPLE

26       Print process information about the processes in a pipeline  using  the
27       SysV ps program before reading the output of that pipeline:
28
29              set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"]
30              # Print process information
31              exec ps -fp [pid $pipeline] >@stdout
32              # Print a separator and then the output of the pipeline
33              puts [string repeat - 70]
34              puts [read $pipeline]
35              close $pipeline
36
37

SEE ALSO

39       exec(n), open(n)
40
41

KEYWORDS

43       file, pipeline, process identifier
44
45
46
47Tcl                                   7.0                               pid(n)
Impressum