I am trying to write a log file and output to a console at the same time The below works well. However I have a sleep timer and the logfile counts down each second and fills the log. The "Sleeping for..." is in stdout not in the stderr.
watch_dog > >(tee -a ${LOGFILE}) 2> >(tee -a ${LOGFILE} 2>&1)
I would like to add
grep -v "Sleeping for..."
The console should still dislpay everything. The log file should omit any line that has "Sleeping for..." Any help would be greatly appreciated.
Something like
watch_dog > >(grep -v "Sleeping for..." | tee -a ${LOGFILE}) 2> >(tee -a ${LOGFILE} 2>&1)
or
watch_dog 2>&1 | tee >( grep -v 'Sleeping for...' >${LOGFILE} )
However these don't work