AIX grep has a 2048 character limit on the input lines. Apparently, it optimizes plain (non-regex) patterns, which enables it to work on longer strings; but with non-plain patterns, it does not truncate the line, but fail hard:
$ grep grepme Makefile.am >/dev/null; echo $? 0 $ grep .grepme Makefile.am >/dev/null; echo $? grep: 0652-226 Maximum line length of 2048 exceeded. 2 So only a literal pattern works, but not the one used in longlin2.test. Since longlin2.test seems to have been added to test Automake's wrapping functionality rather than `grep', I think it's sufficient to just skip this part: we can be reasonably sure the shell is able to create such long lines (and even if it could not, it would not be what this test wants to find out; that could be done by using 'tr', if desired). So, OK to apply this patch, which allows longlin2.test to pass on AIX <= 5.1 (5.2 seems to have a better grep)? Cheers, Ralf * tests/longlin2.test: Do not use `grep' on Makefile.am: it has long lines and is thus not a text file; AIX 5.1 grep fails to scan non-plain patterns from long lines. Index: tests/longlin2.test =================================================================== RCS file: /cvs/automake/automake/tests/longlin2.test,v retrieving revision 1.2 diff -u -r1.2 longlin2.test --- tests/longlin2.test 14 May 2005 20:28:55 -0000 1.2 +++ tests/longlin2.test 27 Apr 2006 17:34:38 -0000 @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 2005, 2006 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -42,10 +42,10 @@ EOF # The `FOO = ...' line is 2293-byte long. More than what a POSIX -# conforment system is expected to support. +# conformant system is expected to support. So do not use grep +# on the non-text file. -# (It's OK if grep truncates the long line.) -grep $match Makefile.am +# grep $match Makefile.am $ACLOCAL $AUTOMAKE