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)
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)
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)
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)
Dear Unix Gurus,
Here is my query.
If i start a script,it inturn calls many other scripts ..and most of them continue to run in parallel.
Suppose,if i want to stop my script for some reason,i need to kill -9 each of the processes running.It becomes clumsy if the sub processes r more.
... (15 Replies)
hi all:
what does the following command do. give me a clear explanation.
ps -ef | grep prg1 | grep -v grep | awk '{print $5}'
any help will be appreciated....
Bankpro :) (7 Replies)
My problem is more a question of how to do it more elegantly than how to do it at all. The problem:
I have a pipeline which has to write to the screen AND to a logfile:
proc1 | tee -a <logfile>
What makes things difficult is i also need the return code of proc1. But
proc1 | tee -a... (6 Replies)
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)
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)
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)
Hi Experts,
below similar thread i posted earlier. Although i wish to know ur suggestion newly.
I want to run a script every 1 minute. I tried with Crontab. But the problem is cron send every 1 mins invertal- mail to the user mailbox.
meanwhile, some expert telling me it is not wise to... (15 Replies)
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)
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)
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)