I have a variable containing a string with a quote:
echo $variable
It's my variable
to be able to use this variable as a legend for ffmpeg, I need to add 5 backslashes before the quote:
variable="It\\\\\'s my variable"
I'm confused as to what syntax I should use, as the backslashes and quotes have very specific meanings in bash replace commands. I have tried this:
variable=`echo $variable | tr "'" "\\\\\'"`
but it does not produce the correct result