Suppress warning output in bash

bash, mysql, ubuntu

Solution

mysql_tzinfo_to_sql /usr/share/zoneinfo 2>/dev/null | mysql -u root mysql

The command that is producing the error output to STDERR is the first command, not the second one. Put the STDERR redirection before the pipe, and this should fix your problem.

Problem

``` mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql ``` I tried adding 2>/dev/null, &>/dev/null, etc, nothing seemed to suppress the warnings.

Original source