I have a command cmd
that I want to use in a zsh script in the form:
cmd -opt val > info.txt
but I want to redirect stderr from that one line to /dev/null
.
Evidently the following does not work:
cmd -opt val > info.txt > /dev/null
How to do it?
Added: Note that I do not want any regular output written to the terminal; all regular output should be written into the specified file info.txt
.