On Sat, 17 Jan 2004, Gary Kline wrote:
>
> I've written scores of scripts to hack text files, but this
> one has me dead in the water.
>
> How can I delete all lines from /^PATTERN to EOF??
>
> ed - <<foo
>
> /^PATTERN
> (.,$)d
> w
> q
> foo
>
> or anything else I've tried doesn't do it. I could do it in
> C/C++,but c'mon... ! Any solutions in sed, perl, or ed/ex?
Well, you didn't mention awk, but...
awk '$0 ~ /^PATTERN/ {x=1}; {if (x!=1) print $0}' < foo > bar
--
David Fleck
[EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"