I have a query string (stored in $QUERY_DISCREPANCIES
) such as:
SELECT (field_a * 100) / 2
FROM ...
I am attempting to add the executed query into an email that I send out. The email template contains a row with <QUERY>
. However when I use String substitution as follows:
email=${email/<QUERY>/${QUERY_DISCREPANCIES}
then my HTML output is similar to:
my_file.sh query_test.sql templates test 100),2)
Seems that when substituting the *
character, it's not properly escaping it.
Not sure if I can continue to use string substitution, or if I have to resort to something more sophisticated. Help appreciated, my attempts using sed were not very successful.