stumped... .
Nathan Kinkade
nkinkade at ub.edu.bz
Sun Jan 18 11:01:28 PST 2004
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040118/e1d338a8/attachment.bin
More information about the freebsd-questions
mailing list