Sponsored Content
Top Forums Shell Programming and Scripting Kill a process from parent shell within a shell script Post 302393522 by 2retti on Tuesday 9th of February 2010 03:58:20 AM
Old 02-09-2010
Kill a process from parent shell within a shell script

Hi, I am looking for a solution for the following problem:

Im Using tcpdump within a shellskript started in a subshell by using brackets:
Code:
( /usr/sbin/tcpdump -i ... -c 1 )

  • - I want the outout of tcpdump saved in a variable
  • - Than tcpdump-Process in the Subshell should be killed
  • - and I want to use the variable in the parentshell for further steps of the skript

I hope you understand the circumstance and thanks in advance.

2retti

Last edited by 2retti; 02-09-2010 at 05:01 AM.. Reason: Formating
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

2. Shell Programming and Scripting

how to grep parent process PID in shell scripting

hi all, for an example: $ ps -ef | grep apache | awk '{ print $2, $3 }' 24073 11784 28021 1 28022 1 28038 1 28041 28040 28045 28041 28047 28041 28040 1 28049 28041 28051 28041 28053 28041 28030 1 28054 28041 28055 28041 28056 28041 28057 28041 (5 Replies)
Discussion started by: raghur77
5 Replies

3. Shell Programming and Scripting

Shell Script to Kill Process(number of process) Unix/Solaris

Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies

4. Shell Programming and Scripting

shell script to kill process with respect to terminal

Hi, I've a script which kills all process, but i need a script shell script(sh), where it'll kill process on that particular terminal. below is example TY=`tty` for P in $TY do `kill -9 $P 2>/dev/null`; done echo "test process killed" break ... (3 Replies)
Discussion started by: asak
3 Replies

5. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

6. UNIX for Dummies Questions & Answers

Kill Duplicated Process by shell in crontab

Hi! I need your help, please. I'm in AIX node and sometimes listener process from an oracle instance gets duplicated, i mean that it get spawned a second listener process. As we can't apply changes to the databases on this months, i want to build a shell that can identify the second... (6 Replies)
Discussion started by: Pactows
6 Replies

7. Shell Programming and Scripting

Cron job and shell script to kill a process if memory gets to high

Hello, I'd like to set a cron job that runs a shell script every 30 minutes or so to restart a java based service if the memory gets above 80%. Any advice on how to do this? Thanks in advance! - Ryan (19 Replies)
Discussion started by: prometheon123
19 Replies

8. Shell Programming and Scripting

shell script to find a process by name and kill it

hi, Am a newbie to unix and wasnt able to write script to my requirement. I need a shell script, which should find a process by name and kill it. For eg: let the process name be "abc". I have different processes running by this name(abc), so should kill them all. Condition would be: if... (7 Replies)
Discussion started by: fop4658
7 Replies

9. Shell Programming and Scripting

System should not kill the child process when parent id is 1

HI i would like to know how i can simulate a shell scripts for my requirement. example Server name child Process id Parent Process id Vpesh 16013 15637 Server name child Process id Parent Process id Vpesh 16014 15637 Server name child... (1 Reply)
Discussion started by: vpesh
1 Replies

10. Shell Programming and Scripting

Shell script to report file size, pid and also kill the process

Hi All, Looking for a quick LINUX shell script which can continuously monitors the flle size, report the process which is creating a file greater than certain limit and also kill that process. Can someone please help me on this? (4 Replies)
Discussion started by: vasavimacherla
4 Replies
ttt(1)									net								    ttt(1)

NAME
ttt - Tele Traffic Tapper - a standalone program for local, real-time, graphical traffic-monitoring. SYNTAX
ttt [-interface device] [-interval ms] [-dumpfile file [-speed N]] [-yscale (K|M|n)] DESCRIPTION
ttt is the standalone traffic monitor program in the ttt program suite. It displays trafic-data of a local interface. To run ttt, you must be "root" on most systems since only root is allowed to access the network filter device. The ttt program suite is yet another descendant of tcpdump but it is capable of real-time, graphical, local and remote traffic-monitoring. It won't replace tcpdump, rather, it helps you find out what to look into with tcpdump. OPTIONS
-interface device specifies the interface for packet capture. If not specified, the default interface is chosen. -interval ms Sets the interval in Milliseconds. If omitted, a interval of 1000 msec. is used as default. -dumpfile file [-speed N] use a dumpfile (produced by "tcpdump -w") as input. The speed option specifies the acceleration factor of the replay speed. -yscale ('K'|'M'|n) change the scale of y-axis. 'K' and 'M' represent 1000 and 1000000 respectively. EXAMPLES
To run this program the standard way type: ttt To listen only on interface eth0: ttt -interface eth0 AUTHORS
ttt was written by Kenjiro Cho < kjc@csl.sony.co.jp>. This manual page was written by Thomas Scheffczyk <thomas.scheffczyk@verwaltung.uni-mainz.de>, for the Debian GNU/Linux system (but may be used by others). SEE ALSO
tttview(1), tttprobe(1) Kenjiro Cho 1.7 ttt(1)
All times are GMT -4. The time now is 12:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy