[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: awk comands inside m4 macros
From: |
Stepan Kasal |
Subject: |
Re: awk comands inside m4 macros |
Date: |
Sat, 16 Jul 2005 18:53:48 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello,
On Sat, Jul 16, 2005 at 01:54:11PM +0100, Keith Marshall wrote:
> > WANT_BOOST_MAJOR=`echo $boost_min_version | $AWK -F. '{print $1}'`
...
> WANT_BOOST_MAJOR=`echo $boost_min_version | $AWK -F. '{print $[1]}'`
>
> m4 sees $1 as a macro argument, and tries to expand it -- you need to
> separate the `$' and the `1', with quoting, to get `$1' passed through to
> configure unscathed.d
> Alternatively, if depth of quoting becomes an issue, you may need the
> address@hidden|@'
> quadrigraph, in place of the `$'.
Another possibilities are [$]1 or $[]1, depends on your taste.
([$1] doesn't help, m4 still sees the substring "$1".)
I noticed that Paul Eggert uses '{print $ 1}'. This makes use of the fact
that awk syntax allows the optional space.
> Same applies to any of `$0'..`$9'.
... and to '$#'.
Have a nice day,
Stepan Kasal