Man

手冊頁分組描述在哪裡定義?

  • December 31, 2020

我不確定“分組描述”是否是正確的稱呼方式,但我很想知道手冊頁的第一行通常在哪裡定義。這些描述中的大多數不僅限於一個程序。例如,在 Slackware 中:

man rpc

印刷:

RPC(3) BSD 庫函式手冊 RPC(3)

姓名
rpc — 用於遠端過程呼叫的庫常式

概要
...

手冊頁中定義的“BSD 庫函式手冊”描述在哪裡?我已經遞歸地搜尋了這個包的整個原始碼及其手冊頁​​,但我沒有找到任何東西。

rpc(3) 中的標頭由.Dt標題宏定義:

$ zcat  $(man -w 3 rpc) | head
.\" @(#)rpc.3n 1.31 93/08/31 SMI; from SVr4
.\" Copyright 1989 AT&T
.Dd May 7, 1993
.Dt RPC 3
.Os
.Sh NAME
.Nm rpc
.Nd library routines for remote procedure calls
.Sh SYNOPSIS
.In rpc/rpc.h

您可以閱讀以下內容man 7 groff_mdoc

TITLE MACROS
    The title macros are part of the page structure domain but are presented
    first and separately for someone who wishes to start writing a man page
    yesterday.  Three header macros designate the document title or manual
    page title, the operating system, and the date of authorship.  These
    macros are called once at the very beginning of the document and are used
    to construct headers and footers only.

.Dt [⟨document title⟩] [⟨section number⟩] [⟨volume⟩]
        The document title is the subject of the man page and must be in
        CAPITALS due to troff limitations.  If omitted, ‘UNTITLED’ is
        used.  The section number may be a number in the range 1, ..., 9
        or ‘unass’, ‘draft’, or ‘paper’.  If it is specified, and no vol‐
        ume name is given, a default volume name is used.

        Under BSD, the following sections are defined:

        1   BSD General Commands Manual
        2   BSD System Calls Manual
        3   BSD Library Functions Manual
        4   BSD Kernel Interfaces Manual
        5   BSD File Formats Manual
        6   BSD Games Manual
        7   BSD Miscellaneous Information Manual
        8   BSD System Manager's Manual
        9   BSD Kernel Developer's Manual

例如,如果你把它改成.Dt RPC 9你會得到:

RPC(9)   BSD Kernel Developer's Manual   RPC(9) 

引用自:https://unix.stackexchange.com/questions/626920