-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
We use Lmod which sources the file with set -e. It aborts when it encounters line 78:
OpenFOAM-10/etc/config.sh/aliases
Lines 71 to 79 in 73bdbb2
| # Refresh the environment | |
| # ~~~~~~~~~~~~~~~~~~~~~~~ | |
| # For backward-compatibility unalias wmRefresh if it is defined as an alias | |
| if command -V wmRefresh 2> /dev/null | head -1 | grep -q "function" | |
| then | |
| unset wmRefresh | |
| else | |
| unalias wmRefresh 2> /dev/null | |
| fi |
The issue is that wmRefresh can be neither a function nor an alias but the if statement only checks for a function. unalias is then called even if wmRefresh doesn't exist.
It would be very kind if this could be rewritten. At least version 9 is also affected.
If a non-zero exit status matters then maybe something like:
if cmd="$(command -V wmRefresh 2>/dev/null)"
then
cmd="$(echo "${cmd}" | head -1)"
case "${cmd}" in
*function*) unset wmRefresh ;;
*alias*) unalias wmRefresh ;;
esac
fi
unset cmdMetadata
Metadata
Assignees
Labels
No labels