Thread View: gnu.utils.bug
1 messages
1 total messages
Started by greg
Tue, 25 Aug 1992 19:56
Possible SED interval bug.
Author: greg
Date: Tue, 25 Aug 1992 19:56
Date: Tue, 25 Aug 1992 19:56
65 lines
2982 bytes
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.'
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads