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(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)
:confused:
Hi!
I have created a Multhreaded Application in Pro*C (using pthreads) with about 5 Threads running simultaneously. The Application is basically to Update a Centralized Table in Oracle, which updates different rows in the Table (Each Thread updates different rows!). The... (16 Replies)
Hello,
There is a very high load on the mySQL in my server (Unix/Linux (WHM - RedHat 7.3)), in 'TOP' I knew the PID numbers that make the load on the memory... So how can I now the user of this PID?
It's very hard to get it from 'Apache Status' at WHM..
So please help :( !
(High... (14 Replies)
i'm just learning scripting, and have been banging my head against this
I want to check if my WAS6 java process is running and if so..echo me a messages. If not then echo me a different messages
the problem i have is I dont know how to represent a NULL return value. If i grep for a was6... (14 Replies)
Does somebody know how many characters can have a PID as maximum?
I'm trying to get the PID of another process running in the same machine. I'm doing this:
ps -ef | grep "bin/Alime" | grep -v grep | cut -c10-16
but I don't know if I 'll have enough with six chars. Which is the max value... (14 Replies)
Hellow Experts
i have one problem.
i run one script in backgroun.
and i want to kill that script with only script name.....
so what's the solution..
for your info
my script name is "testscript" n it contains "sleep 100"
thanks.... (16 Replies)
Hi all,
i have a script called a.sh and within a.sh it calls b.sh.
when i do a ps -ef | grep a.sh, i get two sets of number
user_test 4225 3250 0 10:31 pts/1 00:00:00 a.sh
when i do a ps -ef | grep b.sh, i get two sets of number
user_test 4269 4225 22 10:31 pts/1 00:00:45... (17 Replies)
Hi All,
i get this output when i do PS UX
tdntp 9263 0.0 0.0 98464 3200 pts/1 S+ 14:16 0:00 vim FAB1_600015_CONRAD.A0_7XYZ12345.000_LT-SWET.01_LTPA25L_
I want to get the PID of certain specefic filename.
so i tried
ps ux | pgrep... (13 Replies)
i want to get tomcat listening port , from a command.
ps -ef | grep catalina | grep -v "grep catalina" | grep -v "catalina.out" | awk '{print $2}' | head -1
output :
-----
1234
Now with this 1234 i need to know , in which port my tomcat is running...
i tried ,
netstat -ao | grep... (14 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)
Hi,
Below is my OS details.
uname -an
SunOS mymachine 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220
I need to know when was my Apache server last started. Whats is the best and most reliable way to find out not just for Apache but for any PID per say?
I am... (16 Replies)
Hello All,
I was looking into creating a script that would be used only to start a Daemon and create a lock file...
F.Y.I. It's for Nagios' NRPE Daemon Plugin...
Anyway when I run the command to start the Daemon (below):
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
And... (14 Replies)
Hi everyone. I've been reading around and am a little bit overwhelmed, hoping to find a kind soul out there to hold my hand through writing my first script. This need has emerged at work and I haven't much experience writing shell scripts, but this is a problem we have with a production environment... (13 Replies)
In a Shell Script what is the most generic way to find in the PID exists or not.
If it does not exist how can I echo the user "PID does not exist" & terminate the unix script ?
If the command can work on most flavors of operating system the more useful I will find it to be.
Current system... (16 Replies)
Hi,
I am simply trying to check if the variable is empty in the code below but it isn;t working. Anything that I might have missed here
#Check if values in job card are not empty
title=`cat $filename | grep "TITLE:" | cut -d ":" -f3`
if ]
then
echo "10:Title Empty" ":Fail">> $rptfile... (13 Replies)