On Sun, Aug 07, 2016 at 11:30:04PM -0500, Peng Yu wrote: > Hi, The following code is not able to replace ENV with `$1`. > > /tmp$ m4 -D ENV='$1' <<< ENV
you can add a empty string between $ and 1 to avoid interpolation. to do
so, your m4 content must be $`'1, not $1.
if your using a shell with rc quoting (rc, es or zsh with rcquotes
option enabled), you can write:
m4 -D ENV='$`''1' <<< ENV
the more readable posix way that comes to my mind is
m4 -D ENV=$\`\'1 <<< ENV
regards
marc
