-1

script:

echo $$
fun()
{
    kill -9 $* && echo Signal Trapped
}

trap "fun" 10

while [ 1 ]
do  
    sleep 100 &
    trap "fun $!" 10
    wait $!
done

Output:

$ bash t.sh 
PID = 4243
Signal Trapped
t.sh: line 1:  4244 Killed                  sleep 100
Signal Trapped

when I execute the script, the above is output. Here, the message is shown as "t.sh: line 1: 4244 Killed sleep 100" once the process is killed. I tried the output and error redirection to /dev/null. But it does not worked. So, Is there any way to suppress the message which is arised by bash.

mohangraj
  • 9,842
  • 19
  • 59
  • 94

1 Answers1

-1

try with dmesg -n -1

the option -n permits to hide outputs with different levels

messiedo
  • 16
  • 1