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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exiting eXceed window kills my process shantaputi UNIX for Dummies Questions & Answers 2 05-31-2007 08:27 AM
how to know that a perticular process is started!!! zing_foru UNIX for Advanced & Expert Users 11 05-19-2007 07:04 AM
Process started on console zverzak UNIX for Dummies Questions & Answers 2 12-07-2006 01:33 AM
PID of process started in background?? stilllooking Shell Programming and Scripting 2 11-16-2004 12:47 AM
exit from telnet kills orbix process edgarm UNIX for Dummies Questions & Answers 1 11-27-2000 11:18 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-10-2008
Registered User
 

Join Date: Jun 2008
Posts: 1
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
Reply With Quote
Forum Sponsor
  #2  
Old 06-10-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Try:
disown $PID
before the kill.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0