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 1>/dev/null 2>&1

The thing is that I don't want any output when I kill that app, but I get the following:

./explode: line 67: 11932 Killed                  runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ 2>/dev/null

What can I do to avoid that output ?

Hi,

I go through i think u should write like below..

runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ 1&2>/dev/null
kill -s SIGKILL $triggerMonitorPID 1&2>/dev/null
Please try this.I think it will work..

if using the ksh, try 'set +b'. See 'man ksh' for details.

Thank you for the reply.

Did that, doesn't work.

try this

 
runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ & triggerMonitorPID=$! 1>/dev/null 2>&1
kill -s SIGKILL $triggerMonitorPID &>/dev/null

Nope...

./explode: line 70: 14267 Killed runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ

which of shell use?
ksh or ksh93 or other?

I think it should be

 
runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ & triggerMonitorPID=$! 2>/dev/null 1>&2
kill -s SIGKILL $triggerMonitorPID 2>/dev/null 1>&2

Try this..

---------- Post updated at 05:34 PM ---------- Previous update was at 05:31 PM ----------

I think it should be

runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ & triggerMonitorPID=$! 2>/dev/null 2>&1
kill -s SIGKILL $triggerMonitorPID 2>/dev/null 1>&2

Why do you think about? what did you change it?

1>/dev/null 2>&1 --> stdout redirect null and stderror redirect stdout
&>/dev/null --> both of stdout and stderror to null

your suggestion
2>/dev/null 1>&2 -->
as result both of fd s goes to /dev/null :wink:

our issue is job messages in shell
my goal is actually escape the shell messages
i think maybe if i take the background job pid and and kill $pid
maybe escape the this message,,

this message is actually is not "kill command any output"
this is shell message so job completion messages
because the we want to kill the job in background and when kill it our shell is output warning message :wink:

now we try

# nohup runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ & triggerMonitorPID=$! 1>/dev/null 2>&1
kill -s SIGKILL $triggerMonitorPID >/dev/null 2>&1

or

# ksh explode

Regards
ygemici

The version is

$ Version M-11/16/88i

---------- Post updated at 08:57 AM ---------- Previous update was at 07:52 AM ----------

nohup doesn't do the trick...I still can see the killed messages...

add the this code before the kill commd and try again

set +m

and let see what happen

Still not working :slight_smile:

+++ Generating & importing our modified MQSC file

+++ Changing ICE-XS settings

Sending output to nohup.out
##########################################################
            EXPLODE - Tue Aug  3 01:30:37 2010
##########################################################
^C
Signal 2 caught...

+++ Restoring ICE-XS settings

./explode: line 70: 15399 Killed                  nohup runmqtrm -m $ourManager -q $ourMQSYS.EVTINITQ

+++ Restoring the QUEUE original settings

+++ Done

command  >/dev/null 2>&1

Already tried it :slight_smile:

I don't why , because I tried , it works ,,

and maybe you can start you script like this :

command 2>/var/log/xxx.log 

I've no idea...if it doesn't work for you...

It's not the output from the app that is the problem, it's the output from the KSH shell, that is the one who is doing the output and saying that "killed ...."

Thank you for your suggestion