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

tom honermann <[email protected]>
Newsgroups gmane.comp.gnu.make.windows
Organization Oracle Corporation
Message-ID <[email protected]>
Note that Cygwin has a few oddities that might explain some of the 
issues that Mark is experiencing.  I've recently been fighting Cygwin in 
similar ways.

In particular, if Cygwin's bash.exe (or sh.exe) is used as the gmake 
shell, Cygwin detects that it is being launched by a non-Cygwin process 
and performs some perturbations of the command line including collapsing 
of (unquoted) backslashes.  The results are then processed by bash/sh as 
UNIX normally would.  Try adding "noglob" to the Cygwin environment 
variable to see if that changes behavior.  The "noglob" option is 
documented at http://www.cygwin.com/cygwin-ug-net/using-cygwinenv.html 
(though the documentation doesn't explain this option particularly 
well).  Also, try quoting paths in command lines passed through Cygwin 
binaries - doing so affects the extra globbing that Cygwin performs.

I've noticed that the latest Cygwin 1.7 DLL seems to have some problems 
with the "noglob" option.  There are some command lines I have been 
completely unable to get passed through to Cygwin when using the 
"noglob" option.  I've had to stick to "glob" (the default) and double 
escape backslashes for the time being.

Tom.

On 2/7/2010 1:28 PM, Eli Zaretskii wrote:
>> From: "Mark Galeck (CW)" <[email protected]>
>> CC: "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
>> Date: Sun, 7 Feb 2010 12:44:09 -0800
>>
>>     
>>> 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).  
>>     
>
> It does that only when it does not invoke builtin commands.
>
>
> _______________________________________________
> Make-w32 mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/make-w32
>

_______________________________________________
Make-w32 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/make-w32
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.