I have a bash shell which I need to modify, and I have to set a variable in a script and then call another script. My variable,
EXTRA_JAVA_OPTIONS must be
-javaagent:myagent.jar="-d 0 -i 1000 -l log2 -c log1"
So what I did is
export EXTRA_JAVA_OPTIONS="-javaagent:myagent.jar=\"-d 0 -i 1000 -l log2 -c log1 \""
Then I call my script and inside my script there is the following :
However, this won't produce the result I desire. Running bash -x I can see that
+ /usr/java/jdk1.6.0_38/bin/java '-javaagent:myagent.jar="-d 0 -i 1000 -l log2 -c log1"'
If on the contrary I do:
I got a different version of the output, which is wrong too
+ /usr/java/jdk1.6.0_38/bin/java '-javaagent:myagent.jar="-d' 0 -i 1000 -l log2 -c 'log1"'
How do I prevent
' from appearing when printing my strings, or them to be added by the shell?