I'm trying to redirect stderr to stdout and then use tee
to both show it on sceen and dump to a file.
When running a command with a typo (to which cmd reacts with 'CommandNameWithATypo' is not recognized as an internal or external command, operable program or batch file.
) I expect this error message to be shown on screen and also written to the file specified in the tee
command. However, running this:
CommandNameWithATypo 2>&1 | tee test.txt
I get no output on screen nor to a file (no file is created), as if piping never happened. Is this intended to be like this? May there be a workaround?