By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

TEE command appending null characters to output


The TEE command seems to be appending a null character to the text that it appends to the output files. I first noticed this with TCC 26.01.38, and the behaviour is still present in TCC 26.01.39

For example, executing this and then viewing the output file in something like NotePad++ will reveal a null character at the end of the line:

echo hello | tee test.txt


If anyone else falls foul of this problem, you can work around it by piping the resulting file through the TPIPE command, using the option to remove binary characters.

In my case, I was piping the output from Perforce's P4 command to both the screen and a temporary file, and then using the FIND command to filter out the "info" and "exit" responses from the Perforce server:

p4 ... | TEE temp.txt
TYPE temp.txt | find /v /i "info:" | find /v /i "exit:" > error.txt

The FIND command was confused by the presence of the null characters. Replacing TYPE with TPIPE will work around the problem:

TPIPE /input=error.txt /simple=13 | find /v /i ...


Similar threads