Did I find a bug in egrep or am I misreading the man page?

Adam Moskowitz adamm at necis.UUCP
Sat Jun 11 07:10:40 AEST 1988


While hacking /usr/lib/calendar to get it to understand about "10-Jun-88"-
style dates, I found what I think is a bug in egrep.  I generated the RE:

	'(0*10)([ -]*)([Ju][Uu][Nn][^ ]* *)'
		^^^^^
However, when I did 'egrep RE calendar' I got nothing.  Just for yucks, I
changed '[ -]*' to '[- ]*' and PRESTO - it worked.

Now, the manual page for ed(1) sez: "The following one-character REs match a
single character: . . .  1.4  A non-empty string of characters enclosed in
square brackets ([]) is a one-character RE that matches any single character
in that string. . . . The minus (-) may be used to indicate a range of . . .
The - loses this special meaning if it occurs first . . . or last in the
string."

Seems to me that either the manual page is wrong or egrep doesn't work "as
advertised".  Can anybody out there either confirm this or tell me what I'm
missing?  Oh yes, I've tried this on both a Sun w/s (Sun-2 I think) running
Interleaf and the gods alone know what under that as well as System V.2 on
my NEC XL.  Same results, of course.
-- 
Adam S. Moskowitz	            ...!(backbone)!{necntc,encore}!necis!adamm

     "How long, Dear Savior, oh how long, will this damn 'cc' take?
      Fly swift around ye idle bits and bring the promised a.out"



More information about the Comp.unix.questions mailing list