05-21-2009
for those who care about a solution for this, you can build this inside you script:
typeset -i w=0
while ps $pid >/dev/null
do
sleep 1
w=$w+1
if [ $w -ge 10 ]
then
kill $pid
break
fi
done
This User Gave Thanks to lowmaster For This Post:
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Using a HTML page , i'm running a Unix ksh script with <a href=..>.
The script contains loop like this :
for i in
do
rsh.....
done
each rsh command is running quite long and then i would display results in HTML format but about 5mn my blank page waiting for result is running in error... (1 Reply)
Discussion started by: Nicol
1 Replies
2. Shell Programming and Scripting
Here are a couple of files related to some ideas I have had on providing a mechanism for navigation across a set of "favorite directories."
I would appreciate any comment on the approach and any other useful recommendations.
Please visit my project home page on sourceforge Bash Navigator Home... (0 Replies)
Discussion started by: rlandon@usa.net
0 Replies
3. UNIX for Advanced & Expert Users
I am creating a package(Solaris10 on sparc) that needs user input.
As I understand it, I need to use a request script.
My problem is that the value I set in my request script is not visible in my postinstall script. Not sure if I am doing it right.
Here is an example request script... (4 Replies)
Discussion started by: Tornado
4 Replies
4. Shell Programming and Scripting
Hi all,
This is my first post.
I am new to unix scripting.
My requirement is as follows :
We are using a financial backoffice application.
Now at the end of day we have send users a status report stating all timings of EOD processes for all countries.
I need timings for following... (0 Replies)
Discussion started by: ammbhhar
0 Replies
5. Shell Programming and Scripting
Let's say I have a script which creates a report. I use getopts to have different options available to the user. One of these options is -f which basically exports the output of script to a text file which user may give the name of that text file. How can I output the result to the requested file.... (3 Replies)
Discussion started by: bashily
3 Replies
6. Shell Programming and Scripting
i have a very big script i have that i'd like to add a timeout to.
this script runs on a several remote host. i update this script with timeout clause and then copy it over to all the hosts on which it is currently on.
basically, i want the timeout to make the script abort/exit if it's... (1 Reply)
Discussion started by: SkySmart
1 Replies
7. Shell Programming and Scripting
I have two shell scripts, one written with xargs for parallel processing (p1) and the other written in old school way (p3) .
when I execute them, i get the below values.
$ time ./p1
real 0m25.36s
user 0m0.32s
sys 0m0.80s
$ time ./p3
real 0m23.25s
user 0m6.20s
sys ... (4 Replies)
Discussion started by: luhah
4 Replies
8. Shell Programming and Scripting
Hello;
I'm having about 800 log files and i'm trying to write a script that report the counts of lines per second or "requests per second" in each log file and report the output which includes the timestamp for the highest lines per second count and the log file name and the highest number per... (5 Replies)
Discussion started by: Katkota
5 Replies
9. Shell Programming and Scripting
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Discussion started by: siegfried
3 Replies
LEARN ABOUT DEBIAN
explain_kill_or_die
explain_kill_or_die(3) Library Functions Manual explain_kill_or_die(3)
NAME
explain_kill_or_die - send signal to a process and report errors
SYNOPSIS
#include <libexplain/kill.h>
void explain_kill_or_die(pid_t pid, int sig);
int explain_kill_on_error(pid_t pid, int sig);
DESCRIPTION
The explain_kill_or_die function is used to call the kill(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_kill(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_kill_on_error function is used to call the kill(2) system call. On failure an explanation will be printed to stderr, obtained
from the explain_kill(3) function, but still returns to the caller.
pid The pid, exactly as to be passed to the kill(2) system call.
sig The sig, exactly as to be passed to the kill(2) system call.
RETURN VALUE
The explain_kill_or_die function only returns on success, see kill(2) for more information. On failure, prints an explanation and exits, it
does not return.
The explain_kill_on_error function always returns the value return by the wrapped kill(2) system call.
EXAMPLE
The explain_kill_or_die function is intended to be used in a fashion similar to the following example:
explain_kill_or_die(pid, sig);
SEE ALSO
kill(2) send signal to a process
explain_kill(3)
explain kill(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_kill_or_die(3)