SED quuestion: delete lines to the end AFTER finding a text pattern

SED quuestion: delete lines to the end AFTER finding a text pattern

am 23.10.2007 07:59:42 von Kompu Kid

Hello All:

Using sed, how do I delete lines all the way to the end of the file
after I find a particular text pattern?

If matters, I use the sed with the -f option. In other words, my sed
commands are read from a file.

Deguza

Re: SED quuestion: delete lines to the end AFTER finding a text pattern

am 23.10.2007 10:24:30 von Stephane CHAZELAS

2007-10-23, 05:59(-00), Kompu Kid:
> Hello All:
>
> Using sed, how do I delete lines all the way to the end of the file
> after I find a particular text pattern?
>
> If matters, I use the sed with the -f option. In other words, my sed
> commands are read from a file.
[...]

sed '/pattern/q'

--
Stéphane

Re: SED quuestion: delete lines to the end AFTER finding a text pattern

am 24.10.2007 02:58:43 von Kompu Kid

On Oct 23, 1:24 am, Stephane CHAZELAS wrote:
> 2007-10-23, 05:59(-00), Kompu Kid:> Hello All:
>
> > Using sed, how do I delete lines all the way to the end of the file
> > after I find a particular text pattern?
>
> > If matters, I use the sed with the -f option. In other words, my sed
> > commands are read from a file.
>
> [...]
>
> sed '/pattern/q'
>
> --
> St=E9phane

Hello Stephane:

Thanks for your help, it works like a charm.

Deguza