autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: awk comands inside m4 macros


From: Keith Marshall
Subject: Re: awk comands inside m4 macros
Date: Sat, 23 Jul 2005 22:50:45 +0100

On Sunday 17 July 2005 3:19 am, Paul Eggert wrote:
> Stepan Kasal <address@hidden> writes:
> > I noticed that Paul Eggert uses '{print $ 1}'.
>
> Yes, I found that to be by far the best solution, as '$ 1' makes it
> clear that it's the Awk '$1' rather than the M4 '$1'.
>
> The $[1], [$]1, and $[]1 solutions are used when you're trying to
> quote the m4 '$1', and they work for Awk too, but it might confuse the
> reader into thinking that another level of M4 quoting might be
> involved.  (The @S|@1 solution is too ugly for words, of course.)

And it was I who suggested it.  Of course, I agree that it is horrendously 
ugly.  I only mentioned it because I recently found it useful as a quick work 
around for quoting $[#] in a shell fragment in an AC_DEFUNed macro -- in one 
context I was finding that over quoted, in another under quoted.  The 
quadrigraph solved the problem, until I was able to find a more elegant way 
around it -- the shell, of course, doesn't allow the space between the `$' 
and the `#'.

Regards,
Keith.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]