Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 2004 13:00:58 -0600
From:      Nathan Kinkade <nkinkade@ub.edu.bz>
To:        Lee Mx <lee_ver_mx@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: stumped... .
Message-ID:  <20040118190058.GP5411@npkfbsd>
In-Reply-To: <BAY8-F43geskuibevDu0002c4d8@hotmail.com>
References:  <BAY8-F43geskuibevDu0002c4d8@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--KimiHFv5Iq53dGjv
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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'
>=20
> This would give line 1 to the pattern, wouldn't it,  Rather than pattern =
to=20
> 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
--=20
gpg --keyserver pgp.mit.edu --recv-keys D8527E49

--KimiHFv5Iq53dGjv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQFACtfqO0ZIEthSfkkRApkeAKDEt8MOkbXLcOR/F8MMHqjoUqoCwQCeNyqo
0dmt45w9oIbqLqs4vG4BF+0=
=RskE
-----END PGP SIGNATURE-----

--KimiHFv5Iq53dGjv--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040118190058.GP5411>