🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #626

Possible SED interval bug.

#626
From: greg
Date: Tue, 25 Aug 1992 19:56
65 lines
2982 bytes
I pulled down v1.09 from prep this morning so that I could compile a
fresh copy under LINUX(c) using shared libraries.  Just a couple of
comments, perhaps I need some clarification.

When the regex syntax is set near the start of main in sed.c the
define RE_NO_BK_BRACES is used.  This of course obviates the need for
backslashes when specifying intervals.  In most other sed's that I
have been exposed to there has always been the need to backslash both
parenthesis and braces when these characters are to have special
meanings.

This conjecture is based on the fact that according to the documents I
have the regular expression syntax in SED is supposed to be compatible
with ED.  I believe that ED requires backslashes to both parenthesis
and backslashes.  I would be interested in comments and or
clarifications.

My second concern has to do with what appears to be an inconsistency
in handling three regular expressions which should be equivalent.

I am attempting to parse out the system name from UUCP work files
generated by Taylor uucp.  These of course are of the form: C.xxxxxxxyzzzz

	Where:   xxxxxxx => System name.
                       y => UUCP transport grade.
                    zzzz => Job sequence number.

The test example which I have been using is:

	/usr/spool/uucp/systemx/C.systemxN0000

	From now on the aforementioned string will be referred to as
	$system.

The following command correctly produces as output: systemx

	echo $system | sed -e 's/.*\.\([a-zA-Z]*\).....$/\1/'

The following command results in a failure to match which generates
the original string as output.

	echo $system | sed -e 'sed -e 's/.*\.\([a-zA-Z]*\).\{5\}$/\1/'

However the following produces as output: systemx

	echo $system | sed -e 'sed -e 's/.*\.\([a-zA-Z]*\).\{5,\}$/\1/'

If my references and understanding of ED's regular expression syntax
is correct the above three should produce identical output.


Any comments, suggestions or clarifications would be appreciated.
Thanks for taking the time to consider this.

                           As always,
                           Dr. G.W. Wettstein
                           Oncology Research Division Computing Facility
                           Fargo Clinic / MeritCare

                           UUCP: uunet!plains!wind!greg
                           INTERNET: greg%wind.UUCP@plains.nodak.edu
                           PHONE: 701-234-2833

`The truest mark of a man's wisdom is his ability to listen to other men
 expound their wisdom.'
Technical Details
Message-ID: <9208251456.AA06251@wind.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!att!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!wind.UUCP!greg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!att!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!wind.UUCP!greg
From: greg@wind.UUCP
Newsgroups: gnu.utils.bug
Subject: Possible SED interval bug.
Message-ID: <9208251456.AA06251@wind.UUCP>
Date: 25 Aug 92 19:56:13 GMT
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 65
Approved: bug-gnu-utils@prep.ai.mit.edu