📄 prepare-manpages.sh
字号:
#! /bin/shecho 'dude, assuming you are running this script from the ecos-docs/tcpip directory'MANPAGE_LIST=`find manpages -type f -name '*.?'`echo "MANPAGE_LIST is $MANPAGE_LIST"echo 'removing the previous file tcpip-manpages.sgml'/bin/rm -f tcpip-manpages.sgmltouch tcpip-manpages.sgmlecho '<!-- HEY YOU!!!!!!!!! -->' >> tcpip-manpages.sgmlecho '<!-- this file is automatically generated by the script -->' >> tcpip-manpages.sgmlecho '<!-- ' " $0 " ' -->' >> tcpip-manpages.sgmlecho '<!-- so PLEASE do not modify it: your changes will be lost -->' >> tcpip-manpages.sgmlecho >> tcpip-manpages.sgmlecho >> tcpip-manpages.sgmlecho "<chapter id=\"tcpip-library-reference\">" >> tcpip-manpages.sgmlecho " <title>TCP/IP Library Reference</title>" >> tcpip-manpages.sgmlecho >> tcpip-manpages.sgmlecho >> tcpip-manpages.sgmlfor manpage in $MANPAGE_LISTdo echo "processing $manpage" # get the title for this section manpage_title=`egrep '^\.Dt' $manpage | awk '{print $2}' | tr 'A-Z' 'a-z'` # note that _ is illegal in an id, so we canonicalize it to - docbook_section_id=`echo $manpage_title | sed 's/_/-/g'` # now prepare out a section and title echo " <sect1 id=\"net-common-tcpip-manpages-$docbook_section_id\">" >> tcpip-manpages.sgml echo " <title>$manpage_title</title>" >> tcpip-manpages.sgml # we make it <screen> so that it is a monospaced font echo " <screen>" >> tcpip-manpages.sgml # now put the contents into this section cat $manpage | groff -Tascii -mandoc | sed 's/\_\(.\)/\1/g' \ | sed 's/\(.\)\(.\)/\1/g' \ | sed 's/\&/\&/g' \ | sed 's/</\</g' \ | sed 's/+o/o/g' >> tcpip-manpages.sgml # now close out the section echo " </screen>" >> tcpip-manpages.sgml echo " </sect1>" >> tcpip-manpages.sgml echo >> tcpip-manpages.sgmldoneecho >> tcpip-manpages.sgmlecho "</chapter>" >> tcpip-manpages.sgmlcat <<EOF >> tcpip-manpages.sgml<!-- Keep this comment at the end of the fileLocal variables:mode: sgmlsgml-omittag:nilsgml-shorttag:tsgml-namecase-general:tsgml-general-insert-case:lowersgml-minimize-attributes:nilsgml-always-quote-attributes:tsgml-indent-step:2sgml-indent-data:tsgml-parent-document:("tcpip.sgml" "book" "chapter")sgml-exposed-tags:nilsgml-local-catalogs:nilsgml-local-ecat-files:nilsgml-doctype:"book"End:-->EOF
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -