From cf861c599943b0f86d06cb6bc3becbf38ef5464b Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Sat, 25 Jun 2022 15:46:47 -0500 Subject: [PATCH] Fix shell determination when running Lmod_test_suite --- init/bash.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init/bash.in b/init/bash.in index b41b1d054..92c07386f 100644 --- a/init/bash.in +++ b/init/bash.in @@ -47,13 +47,18 @@ findExec () fi unset Nm confPath execNm } +findExec READLINK_CMD @readlink@ readlink findExec PS_CMD @ps@ ps findExec EXPR_CMD @expr@ expr findExec BASENAME_CMD @basename@ basename export LMOD_SHELL_PRGM=@my_shell@ -if [ -x $PS_CMD -a -x $EXPR_CMD -a -x $BASENAME_CMD ]; then - my_shell=$($PS_CMD -p $$ -ocomm=) +if [ -x $PS_CMD -a -x $EXPR_CMD -a -x $BASENAME_CMD -a -x $READLINK_CMD ]; then + if [ -f /proc/$$/exe ]; then + my_shell=$($READLINK_CMD /proc/$$/exe) + else + my_shell=$($PS_CMD -p $$ -ocomm=) + fi my_shell=$($EXPR_CMD "$my_shell" : '-*\(.*\)') my_shell=$($BASENAME_CMD $my_shell) case ${my_shell} in