views:

654

answers:

2

Hi

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
A: 

As a workaround, you can create a file containing the tab character, named input.txt (not using nmake), and then say:

all :
    @copy /b input.txt output.txt
pts
Nice trick.I new about it but I'd like to avoid this extra file.
Piotr Dobrogost
A: 

I assume you already have tried to put the tab inside quotes?

all:
    @echo "<TAB>" > output.txt
hlovdal
Yes, I've already tried this. The tab character is then present but quotes also which I don't want since using echo I'm creating another nmake makefile and when quotes are present it doesn't work. I need the tab character alone. Any idea how to avoid outputting quotes in this scenerio?
Piotr Dobrogost