In openfoam, I use foamDictionary to set a string ( 800 "patch" ) for entry timeVsFile in ./controlDict file. As shown, this string includes a double quote.
I define an environment variable a to represent the value 800
a=800
foamDictionary ./controlDict -entry timeVsFile -set '( $a "patch" )'
The correct result should be timeVsFile (800 "patch");
But I get timeVsFile ($a "patch");
Can anyone help me to solve this problem?
Thanks!
Variables are not expanded in single quote.
Output:
To expand the variables within quoting, use double quote.
Output:
It's a jumbled mess, but look at it broken down into
'(',"$a"and')'.So,
this could be done as follows.