Friday, 5 September 2008

"Spacy" batch file tweak

The following code line prints spaces to the output file

ECHO foo=bar > file.txt

Apart that this is not very esthetic, in some cases it is not what you want. But there is a workaround. Just add an additional redirection like this

ECHO foo=bar<NUL: > file.txt

and you'll get rid of it.

No comments: