[Top][All Lists]

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

Re: texindex awk syntax error

From: Bruno Haible
Subject: Re: texindex awk syntax error
Date: Mon, 24 Oct 2022 20:19:50 +0200

Eli Zaretskii wrote:
> > On the system that Bruno was testing, "awk" didn't work so "nawk" was
> > preferred.
> So maybe we should verify that the "awk": we found satisfies our
> needs, and not just rely on the name?

Yes, that would be most in line with the Autoconf principles.

> E.g., we could see what "awk"
> outputs for "--version", and judge by that?

  $prog --version
does not help here, because nawk and mawk don't implement it. But what
works, is a test whether $prog supports the function syntax: On this

  gawk 'function foo () {}' 2>/dev/null
  nawk 'function foo () {}' 2>/dev/null

both have exit code 0, whereas

  awk 'function foo () {}' 2>/dev/null

has exit code 2.

To implement this, use a variant of AC_CHECK_PROGS that accepts a test
argument. (AM_PATH_PROG_WITH_TEST from gnulib/m4/progtest.m4 is not the
right there here, because it searches only for a single program name,
not multiple ones.)


reply via email to

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