So, in the following example:
echo "text to write to file but also not send to stdout" | tee -a $logfile 1> /dev/null
The output does not get printed on the terminal. But when I try doing the same action based on a variable it does not work.
$loud="" if [ -z $loud ]; then route_devnull="1> /dev/null" else route_devnull="" fi echo "text to write to file but also not send to stdout" | tee -a $logfile $route_devnull
How can I get the second example to work? Or should I try another way to suppress the messages?