man
是在线参考手册的快速界面。这些通常存储在/usr/share/man/manN/blah.gz
, 或类似的位置。大多数 Debian 软件包还附带一个README.debian
,它存储在/usr/share/doc/blah/README.debian
.是否有这些文件的自动阅读器,可以找到适当的README.debian
并打开它?
答案1
您可以创建一个简单的 shell 函数并将其放入您的.bashrc
:
readme() {
if [ -e /usr/share/doc/"$1"/README.Debian ]; then
"$PAGER" /usr/share/doc/"$1"/README.Debian
else
echo "No README for $1"
fi
}
使用:
$ readme vlc
$Id: README.Debian 1436 2008-08-31 23:06:34Z xtophe-guest $
Notes for anyone wanting to build Debian packages of VLC.
- Default configuration is supposed to be latest unstable.
- VLC does not link with libdvdcss by default, thus it will not depend
on the libdvdcss packages. However it will use libdvdread that can
optionally open libdvdcss if found. To build packages that link directly
against libdvdcss, remove the --without-dvdcss flag in debian/rules.
$ readme foobar
No README for foobar
如果 Debian 文件不存在,当您查找其他 README 文件(例如经常出现的压缩文件)时,您可以稍微简化一下它。或者收集所有自述文件并提供一个选项,用户可以从中选择要显示的文件。