Expect: No such variable [closed]

我是研究僧i 提交于 2019-12-20 05:54:52

问题


I started using expect. I have a simple script. But I have a problem. I want to init a variable which has a $ an first character:

set mystring "$THIS_IS_MY_STRING%"

So I get an error, because expect expects a variable. How can I fix this?


回答1:


Escape any special characters such as the dollar sign by proceeding them with a backslash, so your code becomes

set mystring "\$THIS_IS_MY_STRING%"


来源:https://stackoverflow.com/questions/27651456/expect-no-such-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!