Module unload command does not work from within a module file

Solution Verified - Updated -

Issue

  • module unload command does not work from within a module file.
  • The complete reproducer:
[root@localhost test]# cat first 
#%Module

append-path PATH /home

[root@localhost test]# cat second 
#%Module

module unload first                                    --> This line will unload the  module named "first"

[root@localhost test]# module list
No Modulefiles Currently Loaded.

[root@localhost test]# module load /home/test/first    --> This will load module named "first"

[root@localhost test]# module list                     -->  module named "first" is loaded
Currently Loaded Modulefiles:
  1) /home/test/first

[root@localhost test]# module load /home/test/second   --> This will load module named "second"

[root@localhost test]# module list                     --> both modules are loaded.
                                                           Here module named "first" should
                                                           have been unloaded since the module
                                                           named "second" contains a line which
                                                           will unload the module named "first" )
Currently Loaded Modulefiles:
  1) /home/test/first    2) /home/test/second

Environment

  • Red Hat Enterprise Linux (RHEL) 6
  • environment-modules-3.2.10-1.el6_5.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.