# HG changeset patch # User Oleksandr Gavenko # Date 1269202913 -7200 # Node ID cbb3da2b12fb8ff98207d2678dda5c1c05f4212c # Parent 95bbda08b4320d1a9b0ce8907f372770ed0264e3 Quoting in cmd. diff -r 95bbda08b432 -r cbb3da2b12fb cmd.rst --- a/cmd.rst Sun Mar 21 20:50:12 2010 +0200 +++ b/cmd.rst Sun Mar 21 22:21:53 2010 +0200 @@ -1,5 +1,29 @@ -*- outline -*- +* Quoting. + + * Arguments are delimited by white space, which is either a space or a tab. + * A string surrounded by double quotation marks is interpreted as a single + argument. + * A double quotation mark preceded by a backslash, \", is interpreted as a + literal double quotation mark. + * Backslashes are interpreted literally, unless they immediately precede a + double quotation mark. + * If an even number of backslashes is followed by a double quotation mark, + then one backslash (\) is placed in the argv array for every pair of + backslashes (\\), and the double quotation mark (") is interpreted as a + string delimiter. + * If an odd number of backslashes is followed by a double quotation mark, + then one backslash (\) is placed in the argv array for every pair of + backslashes (\\) and the double quotation mark is interpreted as an escape + sequence by the remaining backslash, causing a literal double quotation + mark (") to be placed in argv. + * In double quote mark need surround such chars: + & < > [ ] { } ^ = ; ! ' + , ` ~ + + http://msdn.microsoft.com/en-us/library/ms880421.aspx + Parsing C Command-Line Arguments + * Variables. Variable name start with letter and underscore, next chars can be letter,