diff -r 1e9323e7ec88 -r 837f1337c59b cmd.rst --- a/cmd.rst Sat Feb 10 01:28:53 2018 +0200 +++ b/cmd.rst Sat Feb 10 01:30:24 2018 +0200 @@ -9,36 +9,36 @@ 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:: +* 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:: - & < > [ ] { } ^ = ; ! ' + , ` ~ % + & < > [ ] { } ^ = ; ! ' + , ` ~ % - Also all this char can be escaped by ^ char. - * Long line can be truncated by ^ char, in this case trailing white spaces - not allowed. - * To quote percent sign % before alpha char in batch file double it - occurrences or plase in quotes:: + Also all this char can be escaped by ^ char. +* Long line can be truncated by ^ char, in this case trailing white spaces + not allowed. +* To quote percent sign % before alpha char in batch file double it + occurrences or plase in quotes:: - prog '%'HOME'%' "%"HOME"%" %%HOME% + prog '%'HOME'%' "%"HOME"%" %%HOME% - http://msdn.microsoft.com/en-us/library/ms880421.aspx - Parsing C Command-Line Arguments +http://msdn.microsoft.com/en-us/library/ms880421.aspx + Parsing C Command-Line Arguments Variables. ========== @@ -81,6 +81,7 @@ Input from file. ---------------- +:: cmd> set /p VAR=