env: add support for escaping environment substitutions