From owner-freebsd-questions@FreeBSD.ORG Sat Jul 30 19:35:58 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 07E5D16A41F for ; Sat, 30 Jul 2005 19:35:58 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from mail.stovebolt.com (mail.stovebolt.com [66.221.101.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FE8D43D45 for ; Sat, 30 Jul 2005 19:35:57 +0000 (GMT) (envelope-from pauls@utdallas.edu) Received: from [192.168.2.101] (adsl-65-71-93-204.dsl.rcsntx.swbell.net [65.71.93.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.stovebolt.com (Postfix) with ESMTP id 3D3F53FC39 for ; Sat, 30 Jul 2005 14:35:51 -0500 (CDT) Date: Sat, 30 Jul 2005 14:35:31 -0500 From: Paul Schmehl To: f-q Message-ID: <6F3E35504F64CB7D16926AA4@Paul-Schmehls-Computer.local> In-Reply-To: <20050730065757.GA96641@holestein.holy.cow> References: <20050730065757.GA96641@holestein.holy.cow> X-Mailer: Mulberry/4.0.0 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: Shell script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2005 19:35:58 -0000 --On July 30, 2005 2:57:57 AM -0400 Parv wrote: > in message , > wrote Paul Schmehl thusly... >> >> Running what I *thought* was the same sed command in the Makefile >> of the port doesn't solve the problem of the formatting of the man >> pages, but it doesn't generate any errors either: >> >> @${SED} -e '/man\.macros/r man.macros' -e '/man\.macros/d' >> ${WRKSRC}/doc/${f} \ >> > ${WRKDIR}/${f} >> >> Can someone explain what the sed command is doing? The man page >> isn't much help. > > In the 1st part, sed sends the output of file 'man.macros' to > standard out if it exists (otherwise no worries) when sed sees the > 'man\.macros' pattern. > > And the 2d part, just deletes that pattern. > > There in the sed(1) man page all is. Or, line by line try this ... > > rm -f q ; echo polka > p > { echo p ; echo q; echo p; } | sed -e '/p/r p' -e '/p/d' > { echo p ; echo q; echo p; } | sed -e '/p/r q' -e '/p/d' > Thanks! That was the answer. I had to fiddle with it for a while before I understood what it was doing, but it does exactly what I need it to do now. Paul Schmehl (pauls@utdallas.edu) Adjunct Information Security Officer University of Texas at Dallas AVIEN Founding Member http://www.utdallas.edu/