Mangling of '\\' by cygwin dll

Volker Quetschke quetschke@scytek.de
Wed Jul 28 20:43:00 GMT 2004


Hi Corinna,

>>C:\cygwin\bin>\cygwin\home\quetschke\slashtest_cyg.exe '\\\'
>>Arg1:\':
>>_Hmm, one \ escaped and one ' escaped, quotes vanish if not
>>escaped._
>>
>>C:\cygwin\bin>\cygwin\home\quetschke\slashtest_cyg.exe \\\
>>Arg1:\\\:
>>_Nothing special for a non-quoted string._
>>
>>What is the deeper plan for this functionality?
> 
> Quotes are not treated specially in cmd.  But they are used in Cygwin
> to allow applications called from cmd to get values which are otherwise
> difficult to transport.  The rules are fairly simple and match your
> obvservations.  A backslash is always a special character.  So a real
> backslash has to be written as \\, the quoting character itself as
> either \' or \", whatever you used for it.  That's it, basically.  So
> your example '\\\' is treated as an unfinished quote with two characters,
> a backslash and a single quote.
Thanks, yes my small sed problem showed me that I also had to escape
the used \s in that file even though the single \ was conserved it
somehow confused sed.

Consequently using \\ fixes this.

Volker


-- 
If you like my work consider:  http://www.scytek.de/donations.html
PGP/GPG key  (ID: 0x9F8A785D)  available  from  wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913  9E53 3D35 C9BA 9F8A 785D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20040728/7253fc71/attachment.sig>


More information about the Cygwin mailing list