【问题标题】:WHEREIS Command not returning result in AIXWHEREIS 命令在 AIX 中不返回结果
【发布时间】:2015-03-10 19:18:28
【问题描述】:

环境:AIX 5

使用 whereis 不会返回我正在寻找的源/二进制文件的文件名。

例如:

文件在哪里

返回

在哪里:

还使用合适的命令选项(-b,-m,-s)尝试了上述命令..仍然是相同的结果。

任何知道修改此命令的语法以适应 AIX Unix 风格所需的更改的人。

非常感谢您的建议。

【问题讨论】:

  • 在 AIX 上有一个 which <program>

标签: unix aix


【解决方案1】:

我希望询问有关 AIX 问题的人能提供他们正在运行的 AIX 版本。

whereis 适用于我的 6.1 机器和 5.3 机器。我通常使用type。它在 ksh 和 bash 中,并且是内置的。这是我执行的一些命令的日志:

type whereis
whereis is /bin/whereis

whereis whereis
whereis: /usr/bin/whereis

什么文件集在哪里?

lslpp -w /usr/bin/whereis
  File                                        Fileset               Type
  ----------------------------------------------------------------------------
  /usr/bin/whereis                            bos.rte.commands      File

好的。我有什么级别的文件集?

lslpp -ch bos.rte.commands
#Path:Fileset:Level:PTF Id:Action:Status:Date:Time
/usr/lib/objrepos:bos.rte.commands:6.1.8.16::APPLY:COMPLETE:12/26/13:14;44;04
/etc/objrepos:bos.rte.commands:6.1.8.16::APPLY:COMPLETE:12/26/13:14;44;08

我认为 whereis 曾经是一个脚本,但在我的主机上它们是二进制可执行文件。这是我的 5.3 主机上 what 的输出:

what /usr/bin/whereis
/usr/bin/whereis:
        61      1.14  src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos530 7/11/00 12:04:14
        93      1.13  src/bos/usr/bin/whereis/whereis.c, cmdscan, bos53H, h2005_32B1 7/6/05 08:53:01

来自我的 6.1 主机:

what /usr/bin/whereis
/usr/bin/whereis:
        61      1.16  src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos61B, b2007_33A0 8/2/07 13:09:21
        93      1.13.1.1  src/bos/usr/bin/whereis/whereis.c, cmdscan, bos610 2/11/07 14:12:18

如果SHELL 环境变量涉及所有这些,我不会感到惊讶,因此您可能会看到它是否设置为奇怪的东西。我将我的SHELL 设置为/usr/bin/ksh,然后我的.kshrc exec 将我转到bash。 AIX 上的某些脚本顶部没有#!/usr/bin/ksh,这会导致一些问题。到目前为止,我已经有一段时间没有碰到这个了。

我很好奇你发现了什么。我很好奇你运行的是什么级别的 AIX。

祝你好运

【讨论】:

    猜你喜欢
    • 2015-08-26
    • 2019-06-26
    • 2016-06-28
    • 1970-01-01
    • 1970-01-01
    • 2017-12-28
    • 1970-01-01
    • 2016-11-17
    • 1970-01-01
    相关资源
    最近更新 更多