Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!Teknowledge.COM!polya!Neon.Stanford.EDU!maslen
From: maslen@Neon.Stanford.EDU (Thomas Maslen)
Newsgroups: comp.unix.ultrix
Subject: egrep dies [Was: Still buggy after all these years?]
Message-ID: <12070@polya.Stanford.EDU>
Date: 30 Sep 89 03:57:16 GMT
References: <12066@polya.Stanford.EDU>
Sender: news@polya.Stanford.EDU
Reply-To: maslen@Neon.Stanford.EDU (Thomas Maslen)
Organization: Stanford University, Computer Science Dept.
Lines: 31

In article <12066@polya.Stanford.EDU> casley@neon.stanford.edu (Ross Casley) writes:
>There seems to be a bug in calendar.  When I try to run it today I wait a
>long time, then I get several messages that egrep has run out of swap
>space.  Now, calendar works by first running /usr/lib/calendar, which
>generates a pattern that is then fed to egrep.  The pattern is supposed to
>pick out the relevant lines from the calendar file.  My best guess is that
>since today is a Friday and the month changes over the weekend,
>/usr/lib/calendar generates an unusually long pattern.  Then egrep barfs

For what it's worth, here's the pattern from /usr/lib/calendar that
caused egrep to lose it:

(^|[ (,;])(([Ss]ep[^ ]* *|(09|9)/)0*29)([^0123456789]|$)
(^|[ (,;])((\* *)0*29)([^0123456789]|$)
(^|[ (,;])(([Ss]ep[^ ]* *|(09|9)/)0*30)([^0123456789]|$)
(^|[ (,;])((\* *)0*30)([^0123456789]|$)
(^|[ (,;])(([Oo]ct[^ ]* *|(010|10)/)0*1)([^0123456789]|$)
(^|[ (,;])((\* *)0*1)([^0123456789]|$)
(^|[ (,;])(([Oo]ct[^ ]* *|(010|10)/)0*2)([^0123456789]|$)
(^|[ (,;])((\* *)0*2)([^0123456789]|$)

An older version of Ultrix (2.0 -- I kid you not), a local
4.3-derivative, and SunOS (4.0.3) all do rather better on this pattern
(well, OK, SunOS egrep gives up with "regular expression too long",
but that's better than crashing and burning).  The SunOS
/usr/lib/calendar also generates a different pattern which is more
digestible, both to the SunOS egrep and to Ultrix 3.1 egrep.

Grrr.

Thomas Maslen					    maslen@neon.stamford.edu