bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ed] in a 'g//' search, ed does not execute chained commands after '


From: address@hidden
Subject: [Bug-ed] in a 'g//' search, ed does not execute chained commands after 'a', 'i', 'c'
Date: Tue, 29 Jun 2010 15:03:31 +0300

When chaining multiple commands with a g// search, GNU ed stops at the
first 'a', 'i', or 'c' and does not execute any commands after it. It
does not even examine them for syntax errors. The ed implementation
supplied with Mac OS X Leopard executes as expected, see the example
below.

Note that in the second command, ed in OS X performs the command on
one matched line before stopping due to the syntax error. This is
probably not expected either, ed should not do anything if there is a
syntax error. But this behaviour is better than not reporting the
error at all and silently succeeding.

GNU ed:
$ ed
H
P
*a
foobar
foobaz
.
*g/foo/a\
spam\
.\
p
*# nothing printed here, contrast with OS X
*g/foo/a\
eggs\
.\
nonexistentcommand
*# no error printed here
*1,$p
foobar
eggs
spam
foobaz
eggs
spam
*# command done instead of stopping due to syntax error

Mac OS X Leopard:
$ ed
H
P
*a
foobar
foobaz
.
*g/foo/a\
spam\
.\
p
spam
spam
*g/foo/a\
eggs\
.\
nonexistentcommand
?
invalid command suffix
*1,$p
foobar
eggs
spam
foobaz
spam
*



reply via email to

[Prev in Thread] Current Thread [Next in Thread]