I'm running an az CLI command az mysql db show. At first, the DB doesn't exist, but that case is handled in a try/catch block. There is an error message printed:
ERROR: The requested resource of type 'Microsoft.DBforMySQL/servers/databases' with name 'my_name' was not found.
I would like to not print this message since I'm handling the error case. I tried different methods to redirect the error output stream to null. I didn't manage to do so. I tried:
command 2> $null # not working
and other approaches.
What is the correct syntax?