From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Le8n2-00032o-37 for garchives@archives.gentoo.org; Mon, 02 Mar 2009 14:06:40 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 357E6E01EE; Mon, 2 Mar 2009 14:06:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 14667E01EE for ; Mon, 2 Mar 2009 14:06:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id AB6746456B for ; Mon, 2 Mar 2009 14:06:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at gentoo.org X-Spam-Score: -2.909 X-Spam-Level: X-Spam-Status: No, score=-2.909 required=5.5 tests=[AWL=0.690, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aske71SDOBd0 for ; Mon, 2 Mar 2009 14:06:32 +0000 (UTC) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id EDCF764360 for ; Mon, 2 Mar 2009 14:06:30 +0000 (UTC) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Le8mk-0000kk-2L for gentoo-user@gentoo.org; Mon, 02 Mar 2009 14:06:22 +0000 Received: from www.buffer.net ([24.73.161.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Mar 2009 14:06:22 +0000 Received: from wireless by www.buffer.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 02 Mar 2009 14:06:22 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: James Subject: [gentoo-user] Re: Grep question Date: Mon, 2 Mar 2009 14:06:11 +0000 (UTC) Message-ID: References: <5602B0BD6D59AE4791BE83104940118D7B1B328A@excprdmbxw002.optus.com.au> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 24.73.161.102 (Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20090216 SeaMonkey/1.1.14) Sender: news X-Archives-Salt: dba5290c-57a0-46d1-a7e4-21cf2be03289 X-Archives-Hash: 430c9fd1c08fca8e403f1acc4bb44dbe Adam Carter optus.com.au> writes: > I need to select all > the lines between string1 and string2 in a file. String1 exists on an entire > line by itself and string2 will be at the start of a line. What's the syntax? I > cant use -A as there is a variable number of lines. AWK is my vote. Old, *SIMPLE* and used by most other packages when pattern matching is involved. Often AWK and SED go together..... As do Perl and AWK http://www.softpanorama.org/Tools/awk.shtml hth, James