Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / share / tcl / help / tcl / processes / pid
1 NAME
2 pid - Retrieve process identifiers
3
4 SYNOPSIS
5 pid ?fileId?
6
7
8 DESCRIPTION
9 If the fileId argument is given then it should normally refer to a
10 process pipeline created with the open command. In this case the pid
11 command will return a list whose elements are the process identifiers
12 of all the processes in the pipeline, in order. The list will be empty
13 if fileId refers to an open file that isn't a process pipeline. If no
14 fileId argument is given then pid returns the process identifier of the
15 current process. All process identifiers are returned as decimal
16 strings.
17
18 EXAMPLE
19 Print process information about the processes in a pipeline using the
20 SysV ps program before reading the output of that pipeline:
21
22 set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"]
23 # Print process information
24 exec ps -fp [pid $pipeline] >@stdout
25 # Print a separator and then the output of the pipeline
26 puts [string repeat - 70]
27 puts [read $pipeline]
28 close $pipeline
29
30
31 SEE ALSO
32 exec(n), open(n)
33
34
35 KEYWORDS