V7's ed is broken too, so that must have been where it happened, since Henry says V6 did it correctly. Also, the 4.3BSD sed doesn't show this bug. Under SVR3.2 on a 386, ed, vi, *and* sed all show the bug. Richard Stevens Health Systems International, New Haven, CT stevens at hsi.com