RE: why does command echo \\\foobar print \\foobar

"Mark Galeck (CW)" <[email protected]>
Newsgroups gmane.comp.gnu.make.windows
Message-ID <49DA8B716852DE4CA0B749102D55CC7A96AC5B1771@HQ-EXCH-6.corp.brocade.com>
>But you already found a way:

  SHELL=cmd.exe

  foobar:
	  echo \\foobar

>(and rename echo.exe to something else, or remove it from PATH).


No, I can't "rename echo.exe or remove it" - I have to support developers where I don't have control whether or not they are using Cygwin.  I can't tell them to remove echo :)

>The way it works with the Windows shell and Windows echo will not
change.

wait, we already established, that this has nothing to do with shell or echo - on Windows, GNU make is currently stripping one of 3 backslashes in a command like this:

Foobar:
	perl foobar.pl \\\foobar


and, I think we have established that this behavior is undocumented ( I think Paul is saying it is a bug, and you are saying you are not sure).  

Right now, my "solution" is to do 
foobar:
	perl foobar.pl \\\\foobar

in order to pass \\foobar to Perl.  Somehow I feel it is safer than 3, but heck I have no clue really.  

This looks funny, and if my boss during a review asks "why do you need 4 backslashes" I will properly have to say "I don't know for sure, but it seems to work" and I can tell you that he will not be satisfied with this answer, because it might start not working one sunny day, when a new version of GNU make is relased.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.