Skip to content

Commit

Permalink
Fix shell determination when running Lmod_test_suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Jun 25, 2022
1 parent 4bad5ea commit cf861c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions init/bash.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf861c5

Please sign in to comment.