Fix issue where msgexport.sh printed the message to STDOUT instead of a file (#1489634)