我想将*roff 格式的原始手册页通过pandoc管道传输到 PDF 并在文档查看器中显示,例如,
$ my_script vim\n...\nRun Code Online (Sandbox Code Playgroud)\n有一个新窗口显示格式化的手册页。
\n我的写作没有其他问题my_script,大部分内容是这样的
zcat /???/vim.?.gz | pandoc -f man -t pdf | okular -\nRun Code Online (Sandbox Code Playgroud)\n但我不知道如何找到 vim 手册页的 *roff 源代码的确切位置,除了它位于$MANPATH.
我知道某些命令有多个手册页,因此我想知道如何检索手册页源的第一个位置。
\n通过阅读man man,您将看到man的-w选项:
-w, --where, --path, --location
Don't actually display the manual page, but do print the
location of the source nroff file that would be formatted.
If the -a option is also used, then print the locations of
all source files that match the search criteria.
Run Code Online (Sandbox Code Playgroud)