I have a linux command:
sudo su - -c "echo 'exit 1'> /usr/lib/ocf/resource.d/oom_check_ocf.bsh"
I want to create this command and store it into a string.
The end portion of the string will be a variable healthScript, such as
healthScript= /usr/lib/ocf/resource.d/oom_check_ocf.bsh
What I have tried:
"sudo su - -c"+" "echo 'exit 1' > +healthScript""
I am confused because the linux command has double quotes in it, which are used to wrap the executed command, which is:
echo 'exit 1'> /usr/lib/ocf/resource.d/oom_check_ocf.bsh
How do I write a string which has double quotes inside?