I am creating and setting a variable in my shell script using following expression.
eval "test2"="'Test Name's Test'"
But it results in following error
-sh: eval: line 1: syntax error: Unterminated quoted string
How can I fix this.
|
I am creating and setting a variable in my shell script using following expression.
But it results in following error
How can I fix this.
| |||
|
feedback
|
|
To get an idea of what will actually be run when
There are three single quotes there, which will never run. And since you can't include single quotes in Bash single-quoted strings (it doesn't even support backslash escaping, unlike many other languages), you'll have to use double quotes if you want to
But as @daniel pointed out, the | |||
|
feedback
|
|
The error message is quite clear here. Unterminated quote is probably referring to the three single quotes on the right hand side. | |||
|
feedback
|
|
First: why the Second: You can't put a single quote
The problem with
| ||||
feedback
|