tee empty file
use ifne
grep -ri website /etc/apache2 | ifne tee /tmp/outout.log
rm also can help:
grep -ri website /etc/apache2 > /tmp/outout.log ; [[ $? -ne 0 ]] && 'rm' -f /tmp/outout.log
tee empty file
use ifne
grep -ri website /etc/apache2 | ifne tee /tmp/outout.log
rm also can help:
grep -ri website /etc/apache2 > /tmp/outout.log ; [[ $? -ne 0 ]] && 'rm' -f /tmp/outout.log