I have defined the string variable
JavaScript
x
2
1
value=“c:/program files/tm su/usr”
2
I need to use this variable in another string like
JavaScript
1
2
1
Bashcmd=“Override project={value}”
2
I tried adding the rf option like this
JavaScript
1
2
1
Bashcmd =rf“Override {value}”
2
But it’s printing only until c:/program, white spaces are neglected. Is there any way to use entire path in Bashcmd and can’t remove spaces in directory path because many system share same paths.
Advertisement
Answer
You can format strings like this:
JavaScript
1
3
1
value="c:/program files/tm su/usr"
2
Bashcmd=f"Override project="{value}""
3
or you can simply concatenate the string like this:
JavaScript
1
2
1
Bashcmd="Override project=""+value+"""
2