From owner-freebsd-questions@FreeBSD.ORG Sat Jul 30 06:57:50 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 5089916A41F for ; Sat, 30 Jul 2005 06:57:50 +0000 (GMT) (envelope-from parv@pair.com) Received: from mta9.adelphia.net (mta9.adelphia.net [68.168.78.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id D70AB43D48 for ; Sat, 30 Jul 2005 06:57:49 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([69.160.76.67]) by mta9.adelphia.net (InterMail vM.6.01.04.01 201-2131-118-101-20041129) with ESMTP id <20050730065745.RIKJ29002.mta9.adelphia.net@default.chvlva.adelphia.net>; Sat, 30 Jul 2005 02:57:45 -0400 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id 6641BB515; Sat, 30 Jul 2005 02:57:57 -0400 (EDT) Date: Sat, 30 Jul 2005 02:57:57 -0400 From: Parv To: Paul Schmehl Message-ID: <20050730065757.GA96641@holestein.holy.cow> Mail-Followup-To: Paul Schmehl , freebsd-questions@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Cc: freebsd-questions@freebsd.org Subject: Re: Shell script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: f-q List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jul 2005 06:57:50 -0000 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' - Parv --