07-17-2008
what I can think of at this moment is to kill the process at the end of your fuctions.. eg
PID=`ps -ef |grep Test | awk '{ print $1 }'`#ensure that PID is in column 1 ($1)
kill -9 ${PID}
8 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Does anybody experiencing this same problem?
I am using IRIX64 ver 6.5 at work.
I wrote some Perl scripts and to execute it.
First I try to put the Perl script at:
/$HOME/bin/perlscript
then I set the correct executable 755 right to the file
I make sure the PATH to the executable... (2 Replies)
Discussion started by: vtran4270
2 Replies
2. Shell Programming and Scripting
Hi All,
I have 3 shell scripts, Script1,Script2 and Script3. Now I want to run Script1 and Script2 in parallel and Script3 should depend on successful completion of both Script1 and Script2.
Could you please suggest an approach of acheiving this...
Thanks in advance (2 Replies)
Discussion started by: itsme_maverick
2 Replies
3. Shell Programming and Scripting
I have a script "a" running in background. From script "a" i will kick off script "b" which will also be in background. Is this possible. And actually what i want is, In script "b" when i do ps -ef, script "a" should not be seen.
Current "a" script
----
---
----
nohup b
exit
current... (1 Reply)
Discussion started by: vasuarjula
1 Replies
4. Solaris
Hi Everyone,
I would like to write a Back-up script for huge files and 3 day old file. I think i need to use Tar command for it. But I am not sure how this can be done. Can someone please assist me on this. (4 Replies)
Discussion started by: gehlnar
4 Replies
5. AIX
I have a user that runs a menu driven application, is there a way to see what scripts this application is executing in the back ground?
OS=AIX 4.3 (1 Reply)
Discussion started by: mangolinux
1 Replies
6. Shell Programming and Scripting
hi guys linux noob here wanting to learn linux scripting, i need help with a backup script that not only allows me to back up my files but restore them to my own personal directory, had a look at some of the coding from the scripts section on this site but still lost.
any help is much appreciated (8 Replies)
Discussion started by: burnie35
8 Replies
7. Shell Programming and Scripting
Dears
i have a scrip run in unix that need to use the tail -f command, as below:
DATE=`date '+%m%d%y'`
tail -f /var/messages | grep "start" >> /export/logs/start_${DATE}.out
but the problem that the tail -f will be stop and working in the background in then end of the day (23:59:59)... (0 Replies)
Discussion started by: thehero
0 Replies
8. Shell Programming and Scripting
Hi friends,
i have two scripts(call it bg1.ksh and bg2.ksh) which needs to be run parallely on background from a script(call it test1.ksh).then i have to wait till these two back ground job gets finished. and once it is completed , then i have to trigger one more script(call it... (4 Replies)
Discussion started by: neelmani
4 Replies
LEARN ABOUT REDHAT
sigqueue
SIGQUEUE(2) Linux Programmer's Manual SIGQUEUE(2)
NAME
sigqueue - queue a signal and data to a process
SYNOPSIS
#include <signal.h>
int sigqueue(pid_t pid, int sig, const union sigval value);
DESCRIPTION
sigqueue() sends the signal specified in sig to the process whose PID is given in pid. The permissions required to send a signal are the
same as for kill(2). As with kill(2), the null signal (0) can be used to check if a process with a given PID exists.
The value argument is used to specify an accompanying item of data (either an integer or a pointer value) to be sent with the signal, and
has the following type:
union sigval {
int sival_int;
void *sival_ptr;
};
If the receiving process has installed a handler for this signal using the SA_SIGINFO flag to sigaction(2), then it can obtain this data
via the si_value field of the siginfo_t structure passed as the second argument to the handler. Furthermore, the si_code field of that
structure will be set to SI_QUEUE.
RETURN VALUE
On success, sigqueue() returns 0, indicating that the signal was successfully queued to the receiving proces. Otherwise -1 is returned and
errno is set to indicate the error.
ERRORS
EAGAIN The limit of signals which may be queued has been reached. (See signal(7) for further information.)
EINVAL sig was invalid.
ESRCH No process has a PID matching pid.
EPERM The process does not have permission to send the signal to the receiving process. (See kill(2) for further information.)
NOTES
If this function results in the sending of a signal to the process that invoked it, and that signal was not blocked by the calling thread,
and no other threads were willing to handle this signal (either by having it unblocked, or by waiting for it using sigwait(3)), then at
least some signal must be delivered to this thread before this function returns.
CONFORMING TO
POSIX 1003.1-2001
SEE ALSO
kill(2), sigaction(2), signal(2), sigwait(3), signal(7)
Linux 2.4.18 2002-06-07 SIGQUEUE(2)