I have a tcsh script that generates a text file. One of the lines in the text file is:
bla bla bla 'foo foo foo "bar bar bar"': etc etc;
Note the nested '
and "
and also the :
and ;
that must be there.
The :
and ;
require the whole string to be surrounded by quotation marks. However, if I do that, I have trouble escaping the quotation marks.
The command is:
echo "bla bla bla 'foo foo foo "bar bar bar"': etc etc;" >> outfile
How can I escape the quotation marks around bar bar bar
so that they get printed correctly?