Skip to main content
4 of 11
edited tags
Vlastimil Burián
  • 31.1k
  • 66
  • 209
  • 358

Hide the stdout from a bash script

I have a daemon script that is suppose to stop and recover the process to run in the background:

process_id=`ps -eaf | grep -i daemon | grep -v grep | grep -v status | grep -v stop | awk '{print $2}'`
(kill -STOP $process_id) &
... # do something else 
(kill -CONT $process_id) &

This is working fine , but then in the STDOUT this appears:

[1]  +  8545 Suspended (signal)            /etc/init.d/...

How can I hide that STDOUT?

toom501
  • 205
  • 4
  • 10