Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/pid.n @ 33

Last change on this file since 33 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 1.6 KB
Line 
1'\"
2'\" Copyright (c) 1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: pid.n,v 1.9 2007/12/13 15:22:33 dgp Exp $
9'\"
10.so man.macros
11.TH pid n 7.0 Tcl "Tcl Built-In Commands"
12.BS
13'\" Note:  do not modify the .SH NAME line immediately below!
14.SH NAME
15pid \- Retrieve process identifiers
16.SH SYNOPSIS
17\fBpid \fR?\fIfileId\fR?
18.BE
19
20.SH DESCRIPTION
21.PP
22If the \fIfileId\fR argument is given then it should normally
23refer to a process pipeline created with the \fBopen\fR command.
24In this case the \fBpid\fR command will return a list whose elements
25are the process identifiers of all the processes in the pipeline,
26in order.
27The list will be empty if \fIfileId\fR refers to an open file
28that is not a process pipeline.
29If no \fIfileId\fR argument is given then \fBpid\fR returns the process
30identifier of the current process.
31All process identifiers are returned as decimal strings.
32.SH EXAMPLE
33Print process information about the processes in a pipeline using the
34SysV \fBps\fR program before reading the output of that pipeline:
35.PP
36.CS
37set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"]
38# Print process information
39exec ps -fp [\fBpid\fR $pipeline] >@stdout
40# Print a separator and then the output of the pipeline
41puts [string repeat - 70]
42puts [read $pipeline]
43close $pipeline
44.CE
45
46.SH "SEE ALSO"
47exec(n), open(n)
48
49.SH KEYWORDS
50file, pipeline, process identifier
Note: See TracBrowser for help on using the repository browser.