Hmmm… maybe I’m focusing on the wrong line. Would I be right in thinking that foreach()
would assign the value to line still with that value containing the escaped \;
, but it is then the evaluation of ${line}
in the message()
call where that escaping is removed to give plain ;
?
My example is a simplified version of the code that gave rise to this query. The original code also evaluates a variable in the same way, but in a command like set(blah ${line} PARENT_SCOPE)
. I maybe missed that this is the evaluation that is doing the unescaping, not foreach()
.