From owner-freebsd-questions Thu Jun 22 8:13:54 2000 Delivered-To: freebsd-questions@freebsd.org Received: from kestrel.prod.itd.earthlink.net (kestrel.prod.itd.earthlink.net [207.217.121.155]) by hub.freebsd.org (Postfix) with ESMTP id 9C8B037B606 for ; Thu, 22 Jun 2000 08:13:51 -0700 (PDT) (envelope-from cjc@earthlink.net) Received: from dialin-client.earthlink.net (pool0592.cvx20-bradley.dialup.earthlink.net [209.179.252.82]) by kestrel.prod.itd.earthlink.net (8.9.3-EL_1_3/8.9.3) with ESMTP id IAA26489; Thu, 22 Jun 2000 08:13:48 -0700 (PDT) Received: (from cjc@localhost) by dialin-client.earthlink.net (8.9.3/8.9.3) id IAA00371; Thu, 22 Jun 2000 08:12:18 -0700 (PDT) Date: Thu, 22 Jun 2000 08:11:47 -0700 From: "Crist J. Clark" To: Dan Larsson Cc: questions@FreeBSD.ORG Subject: Re: getting mailbody using non perl methods Message-ID: <20000622081147.A295@dialin-client.earthlink.net> Reply-To: cjclark@alum.mit.edu References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from dl@tyfon.net on Thu, Jun 22, 2000 at 03:35:34PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Jun 22, 2000 at 03:35:34PM +0200, Dan Larsson wrote: > I need to extract the body from an email. > > Any ideas? Off the top of my head, it's not pretty, but, $ awk '/^From / { inbody = 0 } /^$/ && inbody == 0 { inbody = 1; next } inbody == 1 { print }' < message > body Seems to work. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message