It isn't clear exactly what more needs to be escaped in the following macro to allow it to be used with awk or sed on FreeBSD.
define(`RELAY_MAILER_ARGS', `TCP $h 2525')dnl
Here is an awk command that attempts to insert the above line at line 90 below the SMART_HOST
configuration.
awk 'NR==90 { print "define(\`RELAY_MAILER_ARGS\', \`TCP $h 2525\')dnl"}1' example.com.mc
The command results in the following error:
Unmatched '"'.
Note to future editors: the backtick/single quote is not a typo. This is an ancient quirk of the m4 language that is used to write the macros for Sendmail configuration: "m4 uses single quotes (opening "`" and closing "'") to quote arguments"
Additional Note: Octal escapes don't seem to work when using sed
on FreeBSD. In that situation, use the xNN
escaped hexadecimal characters in that situation.