Shell script help

Paul Schmehl pauls at
Sat Jul 30 06:44:35 GMT 2005

I'm working on a new port, and the one thing I can't seem to solve is the 
man pages.  They install fine, but they're not formatted right.

In the Makefile that is built from configure, this is the section that 
handles the man pages:

@cd $(TOP_DIR)/doc; for i in *.n; \
            do \
            rm -f $(MAN_INSTALL_DIR)/`basename $$i`; \
            rm -f $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
            sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
                $$i > $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
            chmod 444 $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \

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 

Paul Schmehl (pauls at
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member

More information about the freebsd-questions mailing list