James Cammarata wrote:
I've already run into at least one major (in my opinion) Cheetah bug, which was improper handling of escapes. In Cheetah currently you cannot
escape
a , so trying to do \ fails. This was a major nightmare when working on Windows SIFs (response files), since all the paths are MS paths, and needing to have variables in the paths.
The solution was to add a tempate variable for backslashes and render
the
template with that, total nightmare that looked like this:
OriSrc = "${bsp}${bsp}$next_server\REMINST${bsp}$name\i386"
\$var is interpreted as "$var" always, so your variable is not interpreted.
I am guessing it might be \\$foo, not having tried it.
Escape the backslashes and also the dollar sign.
When in doubt you can also build the string in pieces using #set --Michael
The thing is, in the above example you do NOT want to escape the $, you want cheetah to evaluate the variable. Instead, Cheetah always escapes the $ (meaning your variable is not evaluated), and just prints out all the other backslashes.
Noted.... that is annoying if it's not processing the string Left-to-Right. I'd use #set in that case and build it in pieces.
--Michael