Re: qauestion using ed.



On Wed, Aug 02, 2006 at 04:59:03PM -0700, Bill Campbell wrote:
On Wed, Aug 02, 2006, Gary Kline wrote:

Guys,

How, pray tel, do I use ed to delete 23 lines? I can find "foo"
with /foo, but then .,20d or .,+20d or .,+20 d don't work.

.,.+20d

<dot><comma><dot>+20d

If you use the ``ex'' invocation of vi(m), ``20dd'' should do it.

Bill

Thankee! This works for most /patterns, but "<script...."
gives me a bizarre err. This is part of aa javascript cmd
I'm trying to get rid of. I've simplified the /pattern to
/<script type as below. Still get the stuff to stderr.
Any idea what?

gary



--
Gary Kline kline@xxxxxxxxxxx www.thought.org Public service Unix


for files in *.php
do
echo $files
/usr/bin/ex - $files <<\!

/<script type
.,.+10 d
..
w
q
!
done
sync;sync

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: qauestion using ed.
    ... On Wed, Aug 02, 2006, Gary Kline wrote: ... How, pray tel, do I use ed to delete 23 lines? ... I can find "foo" ... slap your name and address on it and mail it to 10,000 people.'' --Dogbert ...
    (freebsd-questions)
  • qauestion using ed.
    ... How, pray tel, do I use ed to delete 23 lines? ... I can find "foo" ... Gary Kline kline@xxxxxxxxxxx www.thought.org Public service Unix ...
    (freebsd-questions)
  • Re: well, blew it... sed or perl q again.
    ... into foo and foo.bar, bar and bar.bak. ... Your perl script can just read FILES and overwrite the stuff in the new ... Gary Kline kline@xxxxxxxxxxx http://www.thought.org Public Service Unix ...
    (freebsd-questions)
  • is there a way to code this .... without curses?
    ... i have written a small program using curses; ... void foo() ... Gary Kline kline@xxxxxxxxxxx http://www.thought.org Public Service Unix ...
    (freebsd-questions)
  • awk quickie.
    ... I've got a bunch of grepped output that has things like ... Gary Kline kline@xxxxxxxxxxx www.thought.org Public service Unix ...
    (freebsd-questions)