On Sun, Jan 18, 2004 at 10:22:46AM -0800, Lee Mx wrote: <snip> > >Here is another option using sed that takes 2 less keystrokes :) > > > >$ sed -e '/pattern/q' > > This would give line 1 to the pattern, wouldn't it, Rather than pattern to > EOF.
Yes, it would give line 1 to the pattern, inclusive. One of his original questions was: "How can I delete all lines from /^PATTERN to EOF??" Unless I'm reading it wrong, he wants to *keep* everything from the beginning of the file to /^PATTERN/ and NOT keep everything else all the way to EOF. The diff. between what I suggested and the what other suggested is that using 'q' would be inclusive, while the others are exclusive of the line matched by /^PATTERN/. However, it wasn't clear which he wanted. Nathan -- gpg --keyserver pgp.mit.edu --recv-keys D8527E49
pgp00000.pgp
Description: PGP signature