[wellylug] vi / ex question

jumbophut jumbophut at gmail.com
Tue Dec 7 16:30:15 NZDT 2004


On Tue, 07 Dec 2004 16:14:42 +1300 (NZDT), jfouhy wrote:
> I know that ... And I know that % is shorthand for 1,$.  But that doesn't work.
> What you are saying (I think) is: "select the range of lines defined by 1,$/^$/
> and then delete them".  It's not clear what that range of lines should be, since
> you seem to be breaking syntax, but it's certainly not what I want..
> 

What I thought I was doing was:

1,$   /$^/d

i.e. select lines 1 through 'end', and for each line try and match
/$^/, deleting if matching.

But as you point out, that doesn't work.  It doesn't create an error,
but it doesn't do what I had hoped.  What is actually does is
highlight all matches for $^, and then delete the first line of the
file, regardless of content!

(I just realised that although I have no Linux at work, I have a
Windows version of Vim, which I should have tested on).

Cheers
Tony

-- 
Tony (echo 'spend!,pocket awide' | sed 'y/acdeikospntw!, /l at omcgtjuba.phi/')




More information about the wellylug mailing list