From 41bfb3b613f3eb11b0288f54124b48bae12fddef Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Sun, 11 Sep 2011 23:01:57 +0100 Subject: [PATCH] Add links to Windows documentation of shell and CRT quote parsing rules --- README.win32 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.win32 b/README.win32 index f7549ae..c7c8fd2 100644 --- a/README.win32 +++ b/README.win32 @@ -487,15 +487,18 @@ using a non-standard shell, be inconsistent). The only (useful) quote character is the double quote ("). It can be used to protect spaces and other special characters in arguments. -The Windows documentation has almost no description of how the -quoting rules are implemented, but here are some general observations -based on experiments: The C runtime breaks arguments at spaces and -passes them to programs in argc/argv. Double quotes can be used to -prevent arguments with spaces in them from being split up. You can -put a double quote in an argument by escaping it with a backslash and -enclosing the whole argument within double quotes. The backslash and -the pair of double quotes surrounding the argument will be stripped by -the C runtime. +The Windows documentation describes the shell parsing rules here: +L +and the C runtime parsing rules here: +L. + +Here are some further observations based on experiments: The C runtime +breaks arguments at spaces and passes them to programs in argc/argv. +Double quotes can be used to prevent arguments with spaces in them from +being split up. You can put a double quote in an argument by escaping +it with a backslash and enclosing the whole argument within double quotes. +The backslash and the pair of double quotes surrounding the argument will +be stripped by the C runtime. The file redirection characters "E", "E", and "|" can be quoted by double quotes (although there are suggestions that this may not always -- 1.8.3.1