From owner-freebsd-questions@FreeBSD.ORG Wed Aug 18 13:53:49 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC941106566B for ; Wed, 18 Aug 2010 13:53:49 +0000 (UTC) (envelope-from ahamiltonwright@mta.ca) Received: from smtpx.mta.ca (smtpx.mta.ca [138.73.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id B15A18FC18 for ; Wed, 18 Aug 2010 13:53:49 +0000 (UTC) Received: from qemg.mta.ca ([138.73.29.51]:49204 helo=qemg.org) by smtpx.mta.ca with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.71) (envelope-from ) id 1Olj5P-0000rU-Gu; Wed, 18 Aug 2010 10:53:47 -0300 Date: Wed, 18 Aug 2010 10:53:47 -0300 (ADT) From: "A. Wright" To: "Jack L. Stone" In-Reply-To: <3.0.1.32.20100818084231.00ecef30@sage-american.com> Message-ID: References: <3.0.1.32.20100818084231.00ecef30@sage-american.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: ahamiltonwright@mta.ca Cc: "freebsd-questions@freebsd.org" Subject: Re: Extracting a variable listing X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2010 13:53:49 -0000 On Wed, 18 Aug 2010, Jack L. Stone wrote: > The content I need will always fall beneath a row of pound signs, and there > is content above that row I don't want, like this: > > bunch of rows I don't need here > ############################### <--- the top of stuff needed > row1 If you want the '#' line in the output cat YourFile | sed -n -e '/#####/,$p' If you don't, then cat YourFile | sed -e '1,/#####/d' The above assumes that you will have at least 5 '#' chars on your divider line, and never before in the file. Increase the number '#' symbols if the above example is strictly literal. Note the -n in the first line. A.