Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jul 2005 02:57:57 -0400
From:      Parv <parv@pair.com>
To:        Paul Schmehl <pauls@utdallas.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Shell script help
Message-ID:  <20050730065757.GA96641@holestein.holy.cow>
In-Reply-To: <E9E44D6085C02C80E233D138@Paul-Schmehls-Computer.local>
References:  <E9E44D6085C02C80E233D138@Paul-Schmehls-Computer.local>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <E9E44D6085C02C80E233D138@Paul-Schmehls-Computer.local>,
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

-- 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050730065757.GA96641>