The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
"syntax error at line 21 :'done' unexpected." error message" ibroxy Shell Programming and Scripting 3 08-08-2007 07:45 AM
SuSe Linux: graphics file "(hd0,8)/boot/message" missing mahatma SuSE 3 10-19-2006 11:29 PM
How can I deny messaging which use "wall" to send message out? wilsonchan1000 UNIX for Dummies Questions & Answers 7 07-17-2002 11:06 PM
Strange "Unable to load interpreter" message! solvman UNIX for Advanced & Expert Users 6 05-15-2002 10:03 PM

Closed Thread
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
  #1 (permalink)  
Old 03-19-2004
kenwolff kenwolff is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 4
How to supress a "Killed" message when a process is terminated?

Does anyone know how I can supress the "Killed" message that's produced when I kill a process? I've got a script that performs a "tail -f" on a database error log and pipes the output into an awk script which looks for certain error messages and forwards any that qualify to my pager. The problem is, the error log gets renamed nightly, so I have to stop and restart my script, in order to pick up the new file. When I kill the "tail -f" process through a different script, a "Killed" message is generated and sent to the user under whom the "tail -f" cron was running. That "Killed" message is what I'm trying to supress. I've tried directing the STDERR to /dev/null, but don't seem to be having any luck. If it matters, this is a Bourne (/bin/sh) shell script.

TIA!
  #2 (permalink)  
Old 03-19-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,126
The "killed" message comes from the shell not the tail. So you need to redirect the shell's file descriptors. Try this:

exec >/dev/null 2>&1
something | tail-f >/dev/tty 2>&1
  #3 (permalink)  
Old 03-22-2004
kenwolff kenwolff is offline
Registered User
  
 

Join Date: Dec 2001
Posts: 4
That seems to help. Thanks very much!
Closed Thread

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 06: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