Re: How to replace with `$1` literally?
Marc Chantreux <[email protected]> Mon, 8 Aug 2016 09:17:55 +0200
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <[email protected]> |
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