无法在 TCL 中创建单次出现双引号的路径

not able to create path with single occurence of double quote in TCL

我在 TCL 中的路径为

set replacementPth "C:/SVN/simulation"

我需要创建一个像

这样的字符串

fopen("C:/SVN/simulation

来自 $replacementPth

我尝试了很多方法来避免出现双引号但都失败了。

例如

set x1 fopen($replacementPth 

给予

fopen(C:/SVN/simulation

任何帮助。
塞迪

您应该在双引号前使用战略反斜杠。

set x1 fopen(\"$replacementPth 

在这一点上,我可能会将整个内容放在双引号中,只是因为它看起来更好(并不是说它有任何语义差异):

set x1 "fopen(\"$replacementPth"