7 :local: |
7 :local: |
8 |
8 |
9 Quoting. |
9 Quoting. |
10 ======== |
10 ======== |
11 |
11 |
12 * Arguments are delimited by white space, which is either a space or a tab. |
12 * Arguments are delimited by white space, which is either a space or a tab. |
13 * A string surrounded by double quotation marks is interpreted as a single |
13 * A string surrounded by double quotation marks is interpreted as a single |
14 argument. |
14 argument. |
15 * A double quotation mark preceded by a backslash, \", is interpreted as a |
15 * A double quotation mark preceded by a backslash, \", is interpreted as a |
16 literal double quotation mark. |
16 literal double quotation mark. |
17 * Backslashes are interpreted literally, unless they immediately precede a |
17 * Backslashes are interpreted literally, unless they immediately precede a |
18 double quotation mark. |
18 double quotation mark. |
19 * If an even number of backslashes is followed by a double quotation mark, |
19 * If an even number of backslashes is followed by a double quotation mark, |
20 then one backslash (\) is placed in the argv array for every pair of |
20 then one backslash (\) is placed in the argv array for every pair of |
21 backslashes (\\), and the double quotation mark (") is interpreted as a |
21 backslashes (\\), and the double quotation mark (") is interpreted as a |
22 string delimiter. |
22 string delimiter. |
23 * If an odd number of backslashes is followed by a double quotation mark, |
23 * If an odd number of backslashes is followed by a double quotation mark, |
24 then one backslash (\) is placed in the argv array for every pair of |
24 then one backslash (\) is placed in the argv array for every pair of |
25 backslashes (\\) and the double quotation mark is interpreted as an escape |
25 backslashes (\\) and the double quotation mark is interpreted as an escape |
26 sequence by the remaining backslash, causing a literal double quotation |
26 sequence by the remaining backslash, causing a literal double quotation |
27 mark (") to be placed in argv. |
27 mark (") to be placed in argv. |
28 * In double quote mark need surround such chars:: |
28 * In double quote mark need surround such chars:: |
29 |
29 |
30 & < > [ ] { } ^ = ; ! ' + , ` ~ % |
30 & < > [ ] { } ^ = ; ! ' + , ` ~ % |
31 |
31 |
32 Also all this char can be escaped by ^ char. |
32 Also all this char can be escaped by ^ char. |
33 * Long line can be truncated by ^ char, in this case trailing white spaces |
33 * Long line can be truncated by ^ char, in this case trailing white spaces |
34 not allowed. |
34 not allowed. |
35 * To quote percent sign % before alpha char in batch file double it |
35 * To quote percent sign % before alpha char in batch file double it |
36 occurrences or plase in quotes:: |
36 occurrences or plase in quotes:: |
37 |
37 |
38 prog '%'HOME'%' "%"HOME"%" %%HOME% |
38 prog '%'HOME'%' "%"HOME"%" %%HOME% |
39 |
39 |
40 http://msdn.microsoft.com/en-us/library/ms880421.aspx |
40 http://msdn.microsoft.com/en-us/library/ms880421.aspx |
41 Parsing C Command-Line Arguments |
41 Parsing C Command-Line Arguments |
42 |
42 |
43 Variables. |
43 Variables. |
44 ========== |
44 ========== |
45 |
45 |
46 Variable name start with letter and underscore, next chars can be letter, |
46 Variable name start with letter and underscore, next chars can be letter, |
107 ======= |
108 ======= |
108 |
109 |
109 Variable value and one line command string after expansion can not exceed 8191 |
110 Variable value and one line command string after expansion can not exceed 8191 |
110 characters for Windows XP and later and 2047 for Windows NT, Windows 2000. |
111 characters for Windows XP and later and 2047 for Windows NT, Windows 2000. |
111 |
112 |
112 http://support.microsoft.com/default.aspx?scid=kb;en-us;830473 |
113 http://support.microsoft.com/default.aspx?scid=kb;en-us;830473 |
113 Command prompt (Cmd. exe) command-line string limitation |
114 Command prompt (Cmd. exe) command-line string limitation. |
114 |
115 |
115 How run cmd on 64-bit OS. |
116 How run cmd on 64-bit OS. |
116 ========================= |
117 ========================= |
117 |
118 |
118 From 64-bit process:: |
119 From 64-bit process:: |