Varf - Define one or more variables where the value may contain Java escape sequences allowing to insert new lines, tabs or special Unicode characters. Supported since v3.5.1.
varf <var_name_1>=<value_1> [<var_name_2>=<value_2> ... <var_name_N>=<value_N>]
* Red colour indicates obligatory parameters
- A name for the variable. The name is case sensitive and may not contain spaces.
- Variable value. If the value contains spaces, it must be enclosed in double quotes, e.g. "This is a text containing spaces". Escape sequences will be converted as follows:
\u0008: backspace BS */
\u0009: horizontal tab HT */
\u000a: linefeed LF */
\u000c: form feed FF */
\u000d: carriage return CR */
\u0022: double quote " */
\u0027: single quote ' */
\u005c: backslash \ */
\uNNNN will be converted to the appropriate Unicode character as long as NNNN is a valid Unicode character hexadecimal value
The Varf command always returns 0 (zero).
Varf MULTILINE="Line #1\nLine #2"
- Populate the MULTILINE variable with two lines of text (the '\n' sequence will be converted to new line).
Varf MULTILINE="Line #1\u000aLine #2"
- Same example as above where the new line character is specified through escaped Unicode (new line is ASCII 10, 0x0a).