I have one variable, which is coming from some where like:
VAR1='hhgfhfghhgf"";2Ddgfsaj!!!$#^$\'&%*%~*)_)(_{}||\\/'
Now i have command like this
./myscript.sh '$VAR1'
I am getting that $VAR1 from some diff process and when I display it look exactly as its above.
Now that command is failing as there is already single quote inside variable. In the process where I use it it is expanded at that point, which causes that error.
I have control over myscript.sh but not above command.
Is there any way I can get variable inside my script?
bashdon't take a space on either side of=. It shouldn't bevar = 1butvar=1./myscript.sh '$VAR1'can't fail by itself because the variable is not being expanded.evalstatement? Please include a MCVE showing the errormyscript.sh, but since we don't know what is inside this script, we can not tell what's going wrong. Asider from this, the whole concept of passing the string$VARto the script (instead of the content of the variableVARlooks odd to me, but you will probably know what you are doing here....