问题
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