2

Consider the following:

$ module
cmdModule.c(166):ERROR:11: Usage is 'module command  [arguments ...] '

  Modules Release 3.2.6 2007-02-14 (Copyright GNU GPL v2 1991):

  Usage: module [ switches ] [ subcommand ] [subcommand-args ]

Switches:
(...omissis...)

$ which module
no module in (...long list of my path)

$ alias
alias cp='cp -i'
alias h='history | grep '
alias ls='/usr/local/bin/ls --color=always'
alias mv='mv -i'
alias rm='rm -i'
alias vi='vim'

$

Clearly, the module command is there and is available to execute, but I can't find it (easily). Digging a little bit, I found it on the system, and I noticed that it's an alias to

bin/modulecmd $SHELL

in module installation path.

But why it doesn't appear in the alias list and why - even if it doesn't appear - it work?

Davide
  • 151

2 Answers2

2

Edit: I wonder if something tricky is being done in the alias. Try this:

alias|hd

Edit 2:

The reason I suggested the above is that it's possible to hide aliases. See my question and answer here for details.


Original answer:

Try type -a module it's more comprehensive.

Also, if it's a function, you can see its definition using this:

declare -f module

and you would need to grep these files, plus any that they source, plus any that I left out, to find where it's defined:

  • /etc/profile
  • /etc/bash.bashrc
  • ~/.profile
  • ~/.bashrc
  • ~/.bash_profile
  • ~/.bash_login
0

It's a function.

And it comes from here. It's quite convenient to manage environment variables.

Daniel
  • 1,703