When executing
echo 0 > test.txt
in cmd.exe, the output in test.txt is
0_
where _ means space. Why is there a space appended? Any way to prevent the appending of the space? Thanks!
When executing
echo 0 > test.txt
in cmd.exe, the output in test.txt is
0_
where _ means space. Why is there a space appended? Any way to prevent the appending of the space? Thanks!
The space that gets appended is the space between the "0" and the ">" in your command line. There is a non-obvious way to get rid of it: prepend the redirection to the command instead:
>test.txt echo 0