awk 无需手动输入

awk 无需手动输入

跑步怎么来man awkNo manual entry for awk?坦率地说,我从来没有亲自在我的 Archlinux 系统上安装过 Awk,但我刚刚发现当前的系统(我最后安装的系统)上没有 ,这很man awk奇怪。man gawk另一方面,工作正常。

有什么线索吗?

这是版本加上其他可能相关的输出:

$ awk --version 
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.0)
Copyright (C) 1989, 1991-2020 Free Software Foundation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.

$ which awk
/usr/bin/awk

$ ls -l $(which awk)
lrwxrwxrwx 1 root root 4 Apr 15 07:38 /usr/bin/awk -> gawk

$ which gawk
/usr/bin/gawk

答案1

man man,手册页通常存储在/usr/share/man.

由于 Awk 有多种实现(gawkmawk、 ...),因此它通常是指向要使用的真正 Awk 的符号链接,在您的例子中是 GNU awk。它的联机帮助页也是如此:

$ readlink /usr/share/man/man1/awk.1.gz
/etc/alternatives/awk.1.gz
$ readlink /etc/alternatives/awk.1.gz
/usr/share/man/man1/gawk.1.gz

检查是否可以在 下找到 Awk 链接/usr/share/man

find /usr/share/man/man1 -path '*/awk*'
  • 如果是,则可能是链接损坏,在这种情况下,您可以将其删除并创建指向所需手册页的链接(见下文)。

  • 如果没有,则链接丢失。不知何故,你删除了它,或者它没有发货。这可能可以通过再次安装该软件包来解决。否则,手动创建符号链接:

ln -s /usr/share/man/man1/gawk.1.gz /usr/share/man/man1/awk.1.gz

答案2

手册awk页位于man-pages包中:

% pacman -Qo /usr/share/man/man1/awk.1p.gz
/usr/share/man/man1/awk.1p.gz is owned by man-pages 5.07-2

您必须显式安装此软件包:

% pacman -Qi man-pages
Name            : man-pages
Version         : 5.07-2
Description     : Linux man pages
Architecture    : any
URL             : https://www.kernel.org/doc/man-pages/
Licenses        : GPL  custom
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 5.61 MiB
Packager        : Bartłomiej Piotrowski <[email protected]>
Build Date      : So 09 Aug 2020 17:54:00
Install Date    : Sa 22 Aug 2020 01:56:46
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

相关内容