The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can a child process return a specific value to a parent process ? Ametis1970 High Level Programming 8 04-10-2008 12:22 AM
Killing of a process and send a mail if the process doesnot come up within 2 minutes Prince89 Shell Programming and Scripting 1 02-15-2008 07:10 PM
killing a process bbhayana UNIX for Dummies Questions & Answers 6 06-02-2007 08:58 AM
killing a child process mervin2006 Shell Programming and Scripting 4 05-02-2007 07:16 AM
killing a child process within a shell yerics Shell Programming and Scripting 2 06-27-2003 06:00 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-09-2007
upnix upnix is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 1
Killing child process in ksh

I have a script that (ideally) starts tcpdump, sleeps a given number of seconds, then kills it.

When I do this for 10 seconds or and hour, it works fine. When I try it for 10 hours (the length I actually want) it just doesn't die, and will actually stick around for days.

Relevant part of my script:

secondstime=$(($HOURSRUN * 60 * 60))
tcpdump -ni hme0 -w ${LOGDIRECTORY}${LOGFILE}`date +%m%d`.log -F $EXPRESSIONFILE&
sleep $secondstime
kill %1

Using 'ps', I can see that sleep got the right number of seconds. My ksh version is: @(#)PD KSH v5.2.14 99/07/13.2

Any ideas or better ways to do this would be appreciated.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0