pid.n
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:2k
- '"
- '" Copyright (c) 1993 The Regents of the University of California.
- '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: pid.n,v 1.3.18.1 2004/10/27 14:23:57 dkf Exp $
- '"
- .so man.macros
- .TH pid n 7.0 Tcl "Tcl Built-In Commands"
- .BS
- '" Note: do not modify the .SH NAME line immediately below!
- .SH NAME
- pid - Retrieve process identifiers
- .SH SYNOPSIS
- fBpid fR?fIfileIdfR?
- .BE
- .SH DESCRIPTION
- .PP
- If the fIfileIdfR argument is given then it should normally
- refer to a process pipeline created with the fBopenfR command.
- In this case the fBpidfR command will return a list whose elements
- are the process identifiers of all the processes in the pipeline,
- in order.
- The list will be empty if fIfileIdfR refers to an open file
- that isn't a process pipeline.
- If no fIfileIdfR argument is given then fBpidfR returns the process
- identifier of the current process.
- All process identifiers are returned as decimal strings.
- .SH EXAMPLE
- Print process information about the processes in a pipeline using the
- SysV fBpsfR program before reading the output of that pipeline:
- .PP
- .CS
- set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"]
- # Print process information
- exec ps -fp [fBpidfR $pipeline] >@stdout
- # Print a separator and then the output of the pipeline
- puts [string repeat - 70]
- puts [read $pipeline]
- close $pipeline
- .CE
- .SH "SEE ALSO"
- exec(n), open(n)
- .SH KEYWORDS
- file, pipeline, process identifier