How to get rid of message when script kills process it started?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get rid of message when script kills process it started?
# 1  
Old 06-10-2008
How to get rid of message when script kills process it started?

When I run the following script I get the following error message whcih I would like to suppress when the kill is issued:

./kill.sh: line 13: 31854 Killed nc -l -p 12345

Script:

#!/bin/bash

echo running nc in the background
nc -l -p 12345 &
PID=$!
echo nc pid: $PID

sleep 1

echo about to kill pid: $PID
kill -9 $PID
echo kill rc: $?

exit

* * *

Anyone know how I can suppress that message? Thanks in advance...

Chris
# 2  
Old 06-11-2008
Try:
disown $PID
before the kill.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get rid off Password expiry error message when connecting to sql in script?

I am connecting to sql databases through shell script. Databases that i am connecting will need password change every 60 days. This is according to our security policy and cannot be changed. But this is creating problem when connecting to Databases through shell script . To connect to oracle DB we... (2 Replies)
Discussion started by: pallvi_mahajan
2 Replies

2. Red Hat

How to get rid of zombie process?

Hi, How to get rid of Zombie Process, Kill -9 PID does not seem to be permanent solution, your help will be Appreciated. Thanks (11 Replies)
Discussion started by: szs
11 Replies

3. Shell Programming and Scripting

Script to Send Email to a user when an admin kills process

Can anyone create or give me a script that I can use to email a user automatically when I kill one of their processes? Or Can you give me a script to allow me to email a user (entering email manually) when a process is killed? Like showing what the PID was and a reason the admin killed it? Is... (2 Replies)
Discussion started by: JoeGazz84
2 Replies

4. Shell Programming and Scripting

How get rid of kill output message?

Hi, My problem is the following, I have a little shell script that has a couple of functions... in one function I start an app like this... runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ 1>/dev/null 2>&1 & In another function I kill that app using kill -s SIGKILL $triggerMonitorPID... (15 Replies)
Discussion started by: valiadi
15 Replies

5. UNIX for Dummies Questions & Answers

Exiting eXceed window kills my process

Hi, I run a binary application with GUI accessibility. To launch and close the application i follow the following steps: 1.Log into a console session. Export display to the local workstation. 2.Launch X windows app ( eXceed ) 3.From terminal session go to the my application directory and... (2 Replies)
Discussion started by: shantaputi
2 Replies

6. UNIX for Advanced & Expert Users

how to know that a perticular process is started!!!

Hi all, I wanted a write a script which will start executing whenever a particular process will starts running in a background. Is there is any way in Unix if a directory contents changed then a signal/Interrupt will generated and by taking status of that interrupt I can execute some scripts.... (11 Replies)
Discussion started by: zing_foru
11 Replies

7. UNIX for Dummies Questions & Answers

Process started on console

Please can someone describe what causes undesired process startup on system console. ps -ef output is like: root 1763 1 0 16:22:24 console 0:00 /bin/sh /usr/System........ process is blocking system console for any access (2 Replies)
Discussion started by: zverzak
2 Replies

8. Programming

Child process is not getting started

Hi, When i m trying to run below code,its entering into wait stage. output: In parent pid=2134 // some random value assigned to child process parent waiting..... and then it keeps on waiting for child to get terminate Y this child is not getting... (5 Replies)
Discussion started by: Crab
5 Replies

9. Shell Programming and Scripting

PID of process started in background??

I am having a problem getting the PID of a process I start in the background is a csh. In tcsh and sh it's simple $! give it to you But in csh this just returns Variable syntax From the man page it should work but it doesn't???? Any help. (2 Replies)
Discussion started by: stilllooking
2 Replies

10. UNIX for Dummies Questions & Answers

exit from telnet kills orbix process

Hi, I'm using a bourne shell to kick off a 3rd Pty app. This app uses Orbix. When I exit from the telnet session which started the app or hit CTRL-C at the command line, the orbix process dies, yet all other process remain. I've tried starting the app as a background process, but it still... (1 Reply)
Discussion started by: edgarm
1 Replies
Login or Register to Ask a Question