nmake - how to force echo command to output the tab character?

Piotr Dobrogost picture Piotr Dobrogost · Apr 28, 2009 · Viewed 14.2k times · Source

How to force echo command to output a tab character in MS nmake makefile? Verbatim tabs inserted right into a string after echo command are removed by nmake and don't show up in the output file.

all :
    @echo I WANT TO OUTPUT THE <TAB> CHARACTER HERE! > output.txt

Answer

Eduardo Po&#231;o picture Eduardo Poço · Feb 16, 2012

You can use a variable with TAB char. Put this lines in your .bat file:

set tab=[stroke TAB char from your keyboard]
echo a%tab%b>yourfile.txt

Doing so, yourfile.txt will have text a[TAB]b