[buug] grep weirdness

Claude Rubinson cmsclaud at arches.uga.edu
Mon May 20 22:11:58 PDT 2002


I'm having some weirdness with grep and I'm wondering if anyone's seen
anything like this before.  I did find a work-around but the original
problem still stands.

In a nutshell, I'm recieving a "grep: Regular expression too big" error. I
did a Google search but I only got four hits and they all said the same
thing: "Split your regex into multiple statements, put them in a file and
use the '-f' flag."  In my case, however, the statements are already in a
file and they couldn't be any simpler.

The script:

grep -ftmp mrw

where

tmp is a single-column file (there's a tab character at the end of each
line):
^CASEID
^1
^2
^3
...
^8916

and

mrw is a two-column file delimited by a single tab:
CASEID	relative_person_weight
1	2.2096
2	1.25369
3	0.734946
...	...
8916	0.701728


The workaround is to decrease the size of "tmp."  For my purposes, I was
able to use a subset of 1,111 records (i.e., regexs) which works fine.  I
haven't bothered to determine what the absolute limit is.

Anyone have any idea of what's going on?  It doesn't seem like this should
trigger a "Regular expression too big" error.

Claude






More information about the buug mailing list