#1104566 'module' function not properly initialized on ksh93 login shell

Package:
environment-modules
Source:
environment-modules
Description:
Modular system for handling environment variables
Submitter:
Xavier Delaruelle
Date:
2025-05-02 08:21:02 UTC
Severity:
normal
#1104566#5
Date:
2025-05-02 08:18:38 UTC
From:
To:
Within a ksh93 login shell session, module command is not properly initialized:

$ module --version
-ksh93: module[7]: local: not found
-ksh93: module[19]: [: argument expected

This error is obtained because the module function is initialized in
/etc/profile.d/modules.sh as if current shell was a "bash sh" shell.

Code in /etc/profile.d/modules.sh should be adapted to cope with
$shell variable equaling ksh93, which should lead to the source of
/usr/share/modules/init/ksh file.

Steps to reproduce the issue:

1. apt-get install ksh environment-modules
2. useradd foo
3. chsh -s /bin/ksh93 foo
4. su - foo
5. module --version