Enzovic Konijnig
Enzovic Konijnig

Reputation: 21

bash prevent escaping with echo

I am relatively new to linux and am trying to create a TikZ figure parsing a file. In order to do so I read in the file with a $%&-bash script containing the following statement

echo "\fill[color=blue] ($xp,$zp) circle (5pt);" >> $fout

this results in the following output

^Lill[color=blue] ($xp,$zp) circle (5pt);

Obviously echo escapes the \f and I did not find a way around it. I have tried all options like "-e" "-n" and what have you, have tried all kinds of combinations of " ' etc, but to no avail.

I am stuck as so often with linux, but this time even google didn't help (OMG=Oh My Google!!!!!!!!).

Upvotes: 2

Views: 2440

Answers (1)

d125q
d125q

Reputation: 1666

echo should not do backslash escapes by default, unless -e is specified. You can try echo -E to force turning them off (in case you have aliased echo to echo -e or something).

Alternatively, try using single quotes (although now that I think about it, I don't see how it would help):

echo '\fill[color=blue] ('"$xp,$zp"') circle (5pt);' >> $fout

Upvotes: 3

Related Questions