Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pid(1t) [opensolaris man page]

pid(1T) 						       Tcl Built-In Commands							   pid(1T)

__________________________________________________________________________________________________________________________________________________

NAME
pid - Retrieve process identifiers SYNOPSIS
pid ?fileId? _________________________________________________________________ DESCRIPTION
If the fileId argument is given then it should normally refer to a process pipeline created with the open command. In this case the pid 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 fileId refers to an open file that isn't a process pipeline. If no fileId argument is given then pid returns the process identi- fier of the current process. All process identifiers are returned as decimal strings. EXAMPLE
Print process information about the processes in a pipeline using the SysV ps program before reading the output of that pipeline: set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"] # Print process information exec ps -fp [pid $pipeline] >@stdout # Print a separator and then the output of the pipeline puts [string repeat - 70] puts [read $pipeline] close $pipeline SEE ALSO
exec(1T), open(1T) KEYWORDS
file, pipeline, process identifier ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl 7.0 pid(1T)

Check Out this Related Man Page

pid(n)                                                         Tcl Built-In Commands                                                        pid(n)

__________________________________________________________________________________________________________________________________________________

NAME
pid - Retrieve process identifiers SYNOPSIS
pid ?fileId? _________________________________________________________________ DESCRIPTION
If the fileId argument is given then it should normally refer to a process pipeline created with the open command. In this case the pid 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 fileId refers to an open file that is not a process pipeline. If no fileId argument is given then pid returns the process identi- fier of the current process. All process identifiers are returned as decimal strings. EXAMPLE
Print process information about the processes in a pipeline using the SysV ps program before reading the output of that pipeline: set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"] # Print process information exec ps -fp [pid $pipeline] >@stdout # Print a separator and then the output of the pipeline puts [string repeat - 70] puts [read $pipeline] close $pipeline SEE ALSO
exec(n), open(n) KEYWORDS
file, pipeline, process identifier Tcl 7.0 pid(n)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Obtaining A Process ID (PID)

Is there any way I can get UNIX to return the Process ID of a process when I actually issue the command to invoke the process? For example, if I was to launch an emacs process in batch mode, by issuing the UNIX command : % emacs file.txt& then UNIX would return the Process ID (PID).... (7 Replies)
Discussion started by: 1cuervo
7 Replies

2. UNIX for Dummies Questions & Answers

copy probs

need help....just wanna copy all files with no extensions but with tree-informations to one dir first I make a new directory with all foldertrees...like find / -name "*" -type d >a1 sed -e 's/^/new/g' <a1 >b1 mkdir -p `cat a1` then I wanna copy all specific files with no... (12 Replies)
Discussion started by: svennie
12 Replies

3. UNIX for Dummies Questions & Answers

The Cut command

Hi I'm a newbie to unix and I have a dumb question concerning cutting I'm trying to write up a shell pipeline that will print the name of the file containing the most lines in the current directory Here's what I have so far: wc -l *.* | sort -nr | head -2 | tail -1 | cut -f3 -d" " This... (6 Replies)
Discussion started by: Poison Ivy
6 Replies

4. UNIX for Advanced & Expert Users

SED help

can anyone tell me how I can write a pipeline that determines how many of the 26 letters are in a file using SED? (8 Replies)
Discussion started by: jo calamine
8 Replies

5. Solaris

getting pid of process

hi all, Is there a simple script anyone could through out to me, to find the pid of a process given the name. I actually need to bind this pid to a processor set. I would probably put these comamns in a shell script which would have. a) kick start the executable b) get the pid c) bind it to a... (10 Replies)
Discussion started by: Naanu
10 Replies

6. Shell Programming and Scripting

unexpected pipeline result with find -exec

Hi All, I probably miss something fundamental here. I want to rename a bunch of files in subdirectories (that might contain white spaces) with names that are related. I thought following could do the job: find . -name *.sh -exec mv {} $(echo {} | sed -e 's/0/1/g') \; Now to be able to... (5 Replies)
Discussion started by: blued
5 Replies

7. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

8. Shell Programming and Scripting

How Unix tee to send pipeline output to 2 pipes ?

Hi, I would like to process, filter the same ASCII asynchronous live data stream in more than one pipe pipeline. So the one pipeline should filter out some records using grep key word and more than one pipes pipelines each should grep for another key words, each set seperately for each... (5 Replies)
Discussion started by: jack2
5 Replies

9. Shell Programming and Scripting

Why does the 'pid' keep changing every time?

HI I checked the pid of a process on my machine using this command. ps -ef | awk '/process_name/{ print $2 }' I get the result as 12245 I check it again after 2 mins, I get the result as 12264 I check it again after 2 mins, I get the result as 12289 It keeps on this. How does this pid... (4 Replies)
Discussion started by: ss3944
4 Replies

10. UNIX for Dummies Questions & Answers

Check who is writing to a file? (pid)

Hello, is there a way to check who is writing to a file? (pid) Like someone starts a ftp transfer, is uploading a file and I'd need to know which pid is actually writing to it. Or is there a way to check which file a process is currently accessing? Greetings and thanks for all your... (4 Replies)
Discussion started by: TehOne
4 Replies

11. Shell Programming and Scripting

Closing open file descriptors from /proc/pid/fd

Hi guys, i need to write a shell script that will close file descriptors from /proc/pid/fd will calling exec 4<&- solve the problem ? thanks in advance :) (15 Replies)
Discussion started by: alpha_romeo
15 Replies

12. Shell Programming and Scripting

uniq -c in the pipeline

Hello gurus - I must be missing something, or there is a better way - pls enlighten me I'm on a Solaris 10 vm running the following pipeline to reduce some apache logs (actually lynx dumps of /server-status/ when threads are above a threshold) to a set of offending DDoS IP addresses. awk... (10 Replies)
Discussion started by: fletch00
10 Replies

13. Shell Programming and Scripting

Shell Variable visibility

Dear All, Saying, I have two distinct functions with the same goal (counting lines containing a specific pattern in a file MyFile). To perform that operation, I used a "while loop" with two different syntax ("grep" command would be much more better in that case but this is not the concern in... (8 Replies)
Discussion started by: dae
8 Replies

14. UNIX for Beginners Questions & Answers

Diff between "ps -ef"and "ps -eo"

Hi, have to list current running processes (including sub-processes/child processes). im using ps -eo etime,pid,cmd | grep "process_name" But sometimes, the command is not listing the sub-processes. I assume all processes (processes and sub-processes ) are listed only with ps -ef command, but not... (6 Replies)
Discussion started by: JSKOBS
6 Replies

15. UNIX for Beginners Questions & Answers

Identifying a process

morning, i introduce the following sentence: "sudo lsof -i | grep smtp" ang get a list of the processes. two of them i don't know what is the function: 29574 & 29575, with the following indication: "memo" the rest of the processes shown are smtpd. i kill these two processes and they disappear,... (4 Replies)
Discussion started by: brijan007
4 Replies