@ESCENV — Returns the value of an environment variable, escapified.

Syntax:
%@ESCENV[varname]

varnamethe name of an environment variable

This function is useful with commands such as INPUT or DO var IN @file, which stash text directly in an environment variable without first passing it through the command parser. Do not type a percent sign before the variable name. If you do, TCC’s parser will expand the variable before @ESCENV sees it.

You can use the CESC_CHARS and CESC_FLAGS environment variables to tweak the way text is escapified.

input Type some text: %%text
set text=%@escenv[text]
expecho You typed \u201c%text\u201d.\r\n

Note: If you want to use this function in conjunction with the FOR command, be aware that FOR only stores its control variable in the environment if the variable name is more than one character long.