安装Modules环境管理软件。
Ubuntu 20.04,以前用18.04没问题。
现在apt-get install environment-modules之后,运行module,系统显示找不到命令。
本以为是库问题,自己编译了一个,按照手册,在/etc/profile.d下面建立了两个连接:
ln -s /usr/local/Modules/init/profile.sh /etc/profile.d/modules.sh
ln -s /usr/local/Modules/init/profile.csh /etc/profile.d/modules.csh
但发现还是一样的问题,显示找不到module命令,看来是系统的问题。
系统默认的shell:
cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/usr/bin/bash
/bin/rbash
/usr/bin/rbash
/bin/dash
/usr/bin/dash
/etc/profile.d/modules.sh的内容如下:
# get current shell name by querying shell variables or looking at parent
# process name
if [ -n "${BASH:-}" ]; then
shell=${BASH##*/}
elif [ -n "${ZSH_NAME:-}" ]; then
shell=$ZSH_NAME
else
shell=$(/usr/bin/basename $(/usr/bin/ps -p $$ -ocomm=))
fi
if [ -f /usr/local/Modules/init/$shell ]; then
. /usr/local/Modules/init/$shell
else
. /usr/local/Modules/init/sh
fi
我如果直接source /usr/local/Modules/init/bash,就能找到module命令。
这是何故?
--
修改:VShaka FROM 111.201.210.*
FROM 111.201.210.*