File: module

package info (click to toggle)
lmod 8.7.60-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,008 kB
  • sloc: sh: 6,266; makefile: 2,837; ansic: 1,513; tcl: 1,382; python: 1,050; csh: 112
file content (42 lines) | stat: -rw-r--r-- 1,367 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- shell-script -*-
# This file defines a ksh alias.
# It also ends up in a zsh function directory
# so that zsh users can run this shell function with ksh scripts
if [ -n "${KSH_VERSION+x}" ]; then
  if [ "@silence_shell_debugging@" = "no" ]; then
     module()
     {
       eval "$($LMOD_CMD shell "$@")" && eval $(${LMOD_SETTARG_CMD:-:} -s sh)
     }
  else
     module()
     {
       ############################################################
       # Silence shell debug UNLESS $LMOD_SH_DBG_ON has a value
       if [ -z "${LMOD_SH_DBG_ON+x}" ]; then
          case "$-" in
            *v*x*) __lmod_sh_dbg='vx' ;;
            *v*)   __lmod_sh_dbg='v'  ;;
            *x*)   __lmod_sh_dbg='x'  ;;
          esac;
       fi
       
       if [ -n "${__lmod_sh_dbg:-}" ]; then
          set +$__lmod_sh_dbg 
          echo "Shell debugging temporarily silenced: export LMOD_SH_DBG_ON=1 for Lmod's output" 1>&2
       fi

       eval "$($LMOD_CMD shell "$@")" && eval $(${LMOD_SETTARG_CMD:-:} -s sh)
       __lmod_my_status=$?

       ############################################################
       # Un-silence shell debug after module command
       if [ -n "${__lmod_sh_dbg:-}" ]; then
         echo "Shell debugging restarted" 1>&2
         set -$__lmod_sh_dbg;
         unset __lmod_sh_dbg;
       fi;
       return $__lmod_my_status
     }
  fi
fi