Bash hide "killed"

I do not see to hide the "killed" output from my script. Please, help.

killall -9 $SCRIPT

I tried:

killall -9 $SCRIPT >/dev/null 2>&1

and any combination forwarding seems. Thanks for the help.

* UPDATE *

The main script cannot run in the background. It displays user information to the user during operation. Thanks for the input though. Any other ideas?

Here is the desired result

Ending HEV
Admin @ HEV-DEV: ~ / HEV-1.2.7 $

Here is the current output:

Completion of HEV
Killed
Admin @ HEV-DEV: ~ / HEV-1.2.7 $

+4
source share
3 answers

script , . , , :

./script &
wait 2>/dev/null
+4

, , script ( &) :

$ ( ./script.sh & )
$ ps
  PID TTY          TIME CMD
14208 pts/0    00:00:00 bash
16134 pts/0    00:00:00 script.sh
16135 pts/0    00:00:00 sleep
16136 pts/0    00:00:00 ps
$ killall script.sh
$

( ), ./script.sh,

[1]+  Terminated              ./script.sh &>/dev/null
+1

Try it ...

(killall -9 $SCRIPT) 2>/dev/null

Executes a killall in a subshell, and all output from that subshell is redirected, including the output of KILLED.

0
source

All Articles