首页 > 解决方案 > 像在 erlang 中一样在 shell 中列出模块

问题描述

我在 erlang 中有用于列出模块的模块路径的代码:

code:get_object_code(Module)

我们在 shell 中有类似的东西吗?

我知道我们可以通过以下方式列出 shell 中的模块:

module list

但它特别没有给出特定模块名称的模块路径

我尝试过:

module show module_name
output: ModuleCmd_Display.c(151):ERROR:105: Unable to locate a modulefile for 'module_name'

标签: shellmoduleerlangerlang-shell

解决方案


如果您将名称作为返回的名称,这似乎有效module list。例如,我有两个活动模块:

$ module list
Currently Loaded Modulefiles:
 1) module-info   2) module-git  

我可以询问有关的信息,例如,module-git输出包含模块的文件名,包括目录:

$ module show module-git
-------------------------------------------------------------------
/home/magnus/modules/modulefiles/module-git:

module-whatis   {get last version of the module sources from GitHub}
set-alias       get-modules {git clone git://github.com/cea-hpc/modules.git && cd modules}
-------------------------------------------------------------------

推荐阅读