Slide 50 of 80
Notes:
- The CI first replaces all explicit variable referencing by the variable’s value. Next, all ![expression] references are evaluated and replaced by the result. Then, the CI deals with processing any I/O redirection it encounters on the command line. This order allows a target redirection filename to be contained in a variable or ![expression]. Also, by this time in the command processing, the CI has determined the command name and thus can check the exclusion list to make sure I/O redirection is permitted for the command being executed
- If an I/O redirection symbol is found but the token immediately right of it is not a legal filename, the CI assume I/O redirection was not intended. E.g.: :echo abc does not create a file named “123” but instead echo's: abc
- Also, if the I/O redirection symbol appear inside a quoted string or inside square brackets, it is not interpreted an I/O redirection. E.g.: :echo abc “>xyz” does not create a file named “XYZ” but instead echo's: abc “>xyz”And, :echo abc [>def] does not create a file named “DEF” but instead echo's: abc [>def]The reason that square brackets are excluded is to support selection equations which are contained by square brackets and allow relational operators, such as “<“ and “>”.
- To tell the CI to ignore I/O redirection in commands that it would otherwise accept I/O redirection you need to place a “!” in front of the I/O redirection token. This “escapes” the special meaning of the I/O redirection symbol and is consistent with the use of multiple exclamation marks in front or potential variable names.