pid(n) Tcl Built-In Commands pid(n)
__________________________________________________________________________________________________________________________________________________NAME
pid - Retrieve process id(s)
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.
SEE ALSO
exec(n), open(n)
KEYWORDS
file, pipeline, process identifier
Tcl 7.0 pid(n)
Check Out this Related Man Page
setpgid(3) Library Functions Manual setpgid(3)Name
setpgid - set process group (POSIX)
Syntax
#include <sys/types.h>
int
setpgid(pid, pgrp)
pid_t pid, pgrp;
Description
The function is used to either join an existing process group or create a new process group within the session of the calling process (see
Upon successful completion, the process group ID of the process that has a process ID which matches pid is set to pgrp. If pid is zero,
then the call applies to the current process. In addition, if pgrp is zero, the process ID of the indicated process is used.
This function is available only in the POSIX environment.
Return Values
The function returns 0 when the operation is successful. If the request fails, -1 is returned and the global variable indicates the rea-
son.
Diagnostics
The function fails and the process group is not altered if one of the following occurs:
[EACCES] The value of the pid argument matches the process ID of a child process of the calling process and the child process has
successfully executed an function.
[EINVAL] The value of the pgrp argument is less than zero or is not a supported value.
[EPERM] The process indicated by the pid argument is a session leader.
The value of the pid argument matches the process ID of a child process of the calling process and the child process is not
in the same session as the calling process.
The value of the pgrp argument does not match the process ID of the process indicated by the pid argument and there is no
process with a process group ID that matches the value of the pgrp argument in the same session as the calling process.
[ESRCH] The value of the pid argument does not match the process ID of the calling process of a child process of the calling
process.
See Alsogetpgrp(2), setsid(2)setpgid(3)
: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)