if foo doesn’t have arguments one can use also redirect_stdout(foo, open("/dev/null", "w"))
EDIT2:
I did found that also redirect_stdout(open("nul", "w")) works on linux, and as it is claimed that it works on Windows, this should be an OS independent way to go to suppress output, right ?
function ohne_print(print_function::Expr)
open("nul","w") do muell
oldstd = stdout;
redirect_stdout(muell);
eval(print_function);
redirect_stdout(oldstd);
end
return
end
help?> devnull
search: devnull
devnull
Used in a stream redirect to discard all data written to it. Essentially equivalent to /dev/null on Unix or NUL on Windows.
Usage: