Problem echoing text to shell file with quotes in the middle of the echo command
I have a question that I think might be simple to answer, but I can't crack it after an hour or so of trying.
I am trying to create an installer.sh script that will create other shell scripts in the /usr/local/bin folder
The problem I have is that I want to use this line to echo the output to a file called test.sh
echo "ssh tunnel.somedomain.com.au "echo 2>&1" && echo host OK || sh /usr/local/bin/killtunnel.sh">>/usr/local/bin/test.sh
The line I want to appear in test.sh is
ssh tunnel.somedomain.com.au "echo 2>&1" && echo host OK || sh /usr/local/bin/killtunnel.sh
The problem I have is that there are quotes "" inside quotes which is not working.
Can anyone point me to the correct syntax? Or suggest a better way?