From owner-freebsd-questions@FreeBSD.ORG Sun Jan 18 11:01:27 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBFBE16A4CE for ; Sun, 18 Jan 2004 11:01:27 -0800 (PST) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F35443D2D for ; Sun, 18 Jan 2004 11:01:25 -0800 (PST) (envelope-from nkinkade@fastmail.fm) X-Sasl-enc: 3Exti2qH6xIRbCqIBOE9jg 1074452479 Received: from [206.26.199.146] (unknown [206.27.244.214]) by www.fastmail.fm (Postfix) with ESMTP id 0377B4AE853; Sun, 18 Jan 2004 14:01:19 -0500 (EST) Received: from nkinkade by [206.26.199.146] with local (Exim 4.12) id 1AiIAM-0000ta-00; Sun, 18 Jan 2004 13:00:58 -0600 Date: Sun, 18 Jan 2004 13:00:58 -0600 From: Nathan Kinkade To: Lee Mx Message-ID: <20040118190058.GP5411@npkfbsd> Mail-Followup-To: Lee Mx , freebsd-questions@freebsd.org References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KimiHFv5Iq53dGjv" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: Nathan Kinkade cc: freebsd-questions@freebsd.org Subject: Re: stumped... . X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Nathan Kinkade List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2004 19:01:28 -0000 --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: > >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--