[Top][All Lists]

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

Re: Autoconf Transforms

From: Ralf Wildenhues
Subject: Re: Autoconf Transforms
Date: Wed, 15 Oct 2008 20:43:06 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Tom,

* Tom Browder wrote on Tue, Oct 14, 2008 at 10:24:58PM CEST:
> I am trying to use some raw shell commands in my '' file
> and find that some constructs are not permitted without some care,
> e.g., regex classes, where 's/[^0-9]//' becomes 's/^0-9//' unless one
> doubles the square braces like so 's/[[^0-9]]//' in which case one of
> each pair is stripped away to get the desired form in the resulting
> 'configure' file.  But that may not be the correct way to handle it.

It's a valid way.  You can move the quotes outward:

[ $double_quoted_code
  sed 's/[^0-9]//' ...

and likewise use double [[...]] quoting inside macro arguments.

But this will only work with matched brackets.  You can alternatively
use quadrigraphs @<:@ @:>@  which also works for unmatched brackets.

As yet another alternative, one can use changequote.  Please avoid that,

> I guess the manual is trying to tell me that implicitly by discussing
> the m4 processor parsing rules, but I haven't yet found an explicit
> warning to that effect about use of shell commands (except the
> warnings about portable shell programming and recomended non-use of
> the negated character class form).

Not sure where you expect the warning?

> Are there more such constructs I should be on the lookout for?  Have I
> missed somthing in the manual?

Dunno.  As code is parsed by m4 (with most builtins
redefined), roughly all pitfalls of m4 apply.  The important ones
are AFAIK explained in the Autoconf manual.  But it certainly should
not hurt to look at the M4 manual.  ;-)


reply via email to

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