Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Owner of system commands
Fri, 18 Dec 1992 11:44
sed-1.12 bug (I think)
Author: Owner of system commands
Date: Fri, 18 Dec 1992 11:44
Date: Fri, 18 Dec 1992 11:44
57 lines
1771 bytes
1771 bytes
Machine: Intel 386 running a fairly gnu-ized SCO Unix.
Sed version: sed-1.12
When sed is given a command of the form
sed -n 's/foo/bar/p'
shouldn't sed print _only_ the lines that have been substituted?
Before the "bug", sed prints nothing. A
sed 's/foo/bar/p'
prints duplicates of the substituted lines. My stock sed does what
I expect, but maybe I'm wrong. I fixed the "bug" by doing:
- A PATCH -- A PATCH -- A PATCH -- A PATCH -- A PATCH -- A PATCH -
--- sed.c.orig Fri Dec 18 16:28:00 1992
+++ sed.c Fri Dec 18 16:27:47 1992
@@ -1567,7 +1567,7 @@
ck_fwrite (line.text, 1, line.length,
cur_cmd->x.cmd_regex.wio_file);
if (cur_cmd->x.cmd_regex.flags & S_PRINT_BIT
- && !no_default_output)
+ || !no_default_output)
ck_fwrite (line.text, 1, line.length, stdout);
break;
- A PATCH -- A PATCH -- A PATCH -- A PATCH -- A PATCH -- A PATCH -
If the file /tmp/foo contains the following two lines:
GFLAG:="-g"
AND:=""
and I issue the command
cat /tmp/foo | sed -n -e 's/^\([A-Z][A-Z]*:=\)"\(..*\)"$/\1 \2/p'
I get nothing. If I use SCO's sed, I get
GFLAG:= -g
If I do
cat /tmp/foo | sed -e 's/^\([A-Z][A-Z]*:=\)"\(..*\)"$/\1 \2/p'
I get
GFLAG:= -g
GFLAG:= -g
AND:=""
Hope this is enough information.
Thanks for the good tools.
mike@sojurn.lns.pa.us
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