Hello,
On Sun, Jun 05, 2005 at 06:49:14PM +0200, Ralf Menzel wrote:
> awk: record ` banner-1 1 2 3 4 5 ...' has too many fields
Grrr, Solaris' awk!
I added a comment to your patch and committed; the resulting patch
is attached.
Have a nice day,
Stepan Kasal
2005-06-06 Ralf Menzel <[EMAIL PROTECTED]> (trivial change)
* doc/autoconf.texi (Limitations of Usual Tools): Solaris' awk cannot
swallow records with more than 99 fields.
* lib/autotest/general.m4 (AT_INIT): Use the awk builtin `split' to
parse the long line.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.905
diff -u -r1.905 autoconf.texi
--- doc/autoconf.texi 4 Jun 2005 07:31:48 -0000 1.905
+++ doc/autoconf.texi 6 Jun 2005 07:59:44 -0000
@@ -11516,6 +11516,9 @@
@acronym{AIX} version 5.2 limits on the maximal length of regular
expressions and literal strings in the program to 399.
+Some @command{awk}, such as Solaris 9's native one, have a limit of 99
+fields in a record. You may be able to circumvent this problem by using
+the builtin function @code{split}.
@item @command{cat}
@c ----------------
Index: lib/autotest/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autotest/general.m4,v
retrieving revision 1.181
diff -u -r1.181 general.m4
--- lib/autotest/general.m4 4 Jun 2005 07:30:06 -0000 1.181
+++ lib/autotest/general.m4 6 Jun 2005 07:59:44 -0000
@@ -441,11 +441,13 @@
KEYWORDS
_ATEOF
- # " 1 42 45 " => "^(1|42|45);".
+ # Passing at_groups is tricky. We cannot use it to form a literal string
+ # or regexp because of the limitation of AIX awk. And Solaris' awk
+ # doesn't grok more than 99 fieldsin a record, so we have to use `split'.
echo "$at_groups$as_nl$at_help_all" |
- awk 'NR == 1 {
- for (n = NF; n; n--) selected[[$n]] = 1
- FS = ";"
+ awk 'BEGIN { FS = ";" }
+ NR == 1 {
+ for (n = split($ 0, a, " "); n; n--) selected[[a[n]]] = 1
next
}
{