@silentshdbgsupport@unset _mlshdbg;
@silentshdbgsupport@# disable shell debugging for the run of this init file
@silentshdbgsupport@if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then
@silentshdbgsupport@   # immediately disable debugging to echo the less number of line possible
@silentshdbgsupport@   case "$-" in
@silentshdbgsupport@      *v*x*) set +vx; _mlshdbg='vx' ;;
@silentshdbgsupport@      *v*) set +v; _mlshdbg='v' ;;
@silentshdbgsupport@      *x*) set +x; _mlshdbg='x' ;;
@silentshdbgsupport@      *) _mlshdbg='' ;;
@silentshdbgsupport@   esac;
@silentshdbgsupport@fi;
@silentshdbgsupport@
@quarantinesupport@# define modules runtine quarantine configuration
@quarantinesupport@@setquarvars@export MODULES_RUN_QUARANTINE='@RUN_QUARANTINE@'
@quarantinesupport@@setquarvars@@export RUNENV_VAR='RUNENV_VAL'@
@quarantinesupport@@notsetquarvars@#export MODULES_RUN_QUARANTINE='ENVVARNAME'
@quarantinesupport@@notsetquarvars@
@quarantinesupport@# setup quarantine if defined
@quarantinesupport@unset _mlre _mlIFS;
@quarantinesupport@if [ -n "${IFS+x}" ]; then
@quarantinesupport@   _mlIFS=$IFS;
@quarantinesupport@fi;
@quarantinesupport@IFS=' ';
@quarantinesupport@for _mlv in ${MODULES_RUN_QUARANTINE:-}; do
@quarantinesupport@   if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]; then
@quarantinesupport@      if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then
@quarantinesupport@         _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' ";
@quarantinesupport@      fi;
@quarantinesupport@      _mlrv="MODULES_RUNENV_${_mlv}";
@quarantinesupport@      _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' ";
@quarantinesupport@   fi;
@quarantinesupport@done;
@quarantinesupport@if [ -n "${_mlre:-}" ]; then
@quarantinesupport@   _mlre="eval ${_mlre}";
@quarantinesupport@fi;
@quarantinesupport@
# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init/.modulespath)
@quarantinesupport@_mlcode=`${_mlre:-}@TCLSH@ @libexecdir@/modulecmd.tcl bash autoinit`
@notquarantinesupport@_mlcode=`@TCLSH@ @libexecdir@/modulecmd.tcl bash autoinit`
_mlret=$?

@quarantinesupport@# clean temp variables used to setup quarantine
@quarantinesupport@if [ -n "${_mlIFS+x}" ]; then
@quarantinesupport@   IFS=$_mlIFS; unset _mlIFS;
@quarantinesupport@else
@quarantinesupport@   unset IFS;
@quarantinesupport@fi;
@quarantinesupport@unset _mlre _mlv _mlrv
@quarantinesupport@
# no environment alteration if the above autoinit command failed
if [ $_mlret -eq 0 ]; then
   eval "$_mlcode"

@compatversion@   # redefine module command if compat version has been activated
@compatversion@   if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then
@compatversion@      MODULES_CMD=@libexecdir@/modulecmd-compat; export MODULES_CMD
@compatversion@      if [ -t 2 ]; then
@compatversion@         _module_raw() { eval `@libexecdir@/modulecmd-compat bash $*`; }
@compatversion@      else
@compatversion@         module() { eval `@libexecdir@/modulecmd-compat bash $*`; }
@compatversion@      fi
@compatversion@   fi
@compatversion@
   # export functions to get them defined in sub-shells
   if [ -t 2 ]; then
      export -f _module_raw
   fi
   export -f module

@compatversion@   # define function to switch between C and Tcl versions of Modules
@compatversion@   switchml() {
@compatversion@      typeset swfound=1
@compatversion@      if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then
@compatversion@         typeset swname='main'
@compatversion@         if [ -e @libexecdir@/modulecmd.tcl ]; then
@compatversion@            typeset swfound=0
@compatversion@            unset MODULES_USE_COMPAT_VERSION
@compatversion@         fi
@compatversion@      else
@compatversion@         typeset swname='compatibility'
@compatversion@         if [ -e @libexecdir@/modulecmd-compat ]; then
@compatversion@            typeset swfound=0
@compatversion@            MODULES_USE_COMPAT_VERSION=1; export MODULES_USE_COMPAT_VERSION
@compatversion@         fi
@compatversion@      fi
@compatversion@
@compatversion@      # switch version only if command found
@compatversion@      if [ $swfound -eq 0 ]; then
@compatversion@         echo "Switching to Modules $swname version"
@compatversion@         source @initdir@/bash
@compatversion@      else
@compatversion@         echo "Cannot switch to Modules $swname version, command not found"
@compatversion@         return 1
@compatversion@      fi
@compatversion@   }
@compatversion@   export -f switchml
@compatversion@
   # setup ENV variables to get module defined in sub-shells (works for 'sh'
   # and 'ksh' in interactive mode and 'sh' (zsh-compat), 'bash' and 'ksh'
   # (zsh-compat) in non-interactive mode.
   ENV=@initdir@/profile.sh; export ENV
   BASH_ENV=@initdir@/bash; export BASH_ENV

   # enable completion only in interactive mode
   if [ ${BASH_VERSINFO:-0} -ge 3 ] && [[ $- =~ i ]] &&
      [ -r @initdir@/bash_completion ]; then
      source @initdir@/bash_completion
   fi
@setbinpath@
@setbinpath@   if [[ ! ":$PATH:" =~ ':@bindir@:' ]]; then
@setbinpath@@prependbinpath@      PATH=@bindir@${PATH:+:}$PATH; export PATH
@setbinpath@@appendbinpath@      PATH=$PATH${PATH:+:}@bindir@; export PATH
@setbinpath@   fi
@setmanpath@
@setmanpath@@usemanpath@   manpath=`manpath 2>/dev/null`
@setmanpath@@notusemanpath@   manpath=${MANPATH:-}
@setmanpath@   if [[ ! ":$manpath:" =~ ':@mandir@:' ]]; then
@setmanpath@@prependmanpath@      MANPATH=@mandir@${manpath:+:}$manpath; export MANPATH
@setmanpath@@appendmanpath@      MANPATH=$manpath${manpath:+:}@mandir@; export MANPATH
@setmanpath@   fi
fi

unset _mlcode _mlret
@silentshdbgsupport@
@silentshdbgsupport@# restore shell debugging options if disabled
@silentshdbgsupport@if [ -n "${_mlshdbg:-}" ]; then
@silentshdbgsupport@   set -$_mlshdbg;
@silentshdbgsupport@   unset _mlshdbg;
@silentshdbgsupport@fi;
