===========================
step 1
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --version
===========================
===========================
step 2
buildSh2MF ProjectDIR/rt/sh_to_modulefile/tstScript.sh
===========================
setenv("MY_NAME","tstScript.sh")
prepend_path("PATH","ProjectDIR/rt/sh_to_modulefile/bin")
append_path("PATH","ProjectDIR/rt/sh_to_modulefile/sbin")
setenv("TST_SCRIPT","1")
set_alias("fooAlias","foobin -q -l")
set_shell_function("banner"," \
    local str=\"$1\";\
    local RED='\\033[1;31m';\
    local NONE='\\033[0m';\
    echo \"${RED}${str}${NONE}\"\
","")
set_shell_function("fooFunc"," \
    echo \"arg1: $1\"\
","")
set_shell_function("junk"," \
    if [ -n \"${ZSH_VERSION:-}\" ]; then\
        \\echo \"junk\";\
    fi\
","")
set_shell_function("my_help"," \
    echo \"do not forget \\\"foo\\\"\"\
","")
set_shell_function("save_args"," \
    for arg in \"$@\";\
    do\
        printf \"%s\\n\" \"$arg\" | sed -e \"s/'/'\\\\\\\\''/g\" -e \"1s/^/'/\" -e \"\\$s/\\$/' \\\\\\\\/\";\
    done;\
    echo \" \"\
","")
complete("bash","XyZ123","-F _xyz123")
===========================
step 3
buildSh2MF --to TCL ProjectDIR/rt/sh_to_modulefile/tstScript.sh
===========================
#%Module
setenv MY_NAME {tstScript.sh}
prepend-path PATH {ProjectDIR/rt/sh_to_modulefile/bin}
append-path PATH {ProjectDIR/rt/sh_to_modulefile/sbin}
setenv TST_SCRIPT {1}
set-alias fooAlias {foobin -q -l}
set-function banner {
    local str="$1";
    local RED='\\033[1;31m';
    local NONE='\\033[0m';
    echo "${RED}${str}${NONE}"
}
set-function fooFunc {
    echo "arg1: $1"
}
set-function junk {
    if [ -n "${ZSH_VERSION:-}" ]; then
        \echo "junk";
    fi
}
set-function my_help {
    echo "do not forget \"foo\""
}
set-function save_args {
    for arg in "$@";
    do
        printf "%s\n" "$arg" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/' \\\\/";
    done;
    echo " "
}
complete bash XyZ123 {-F _xyz123}
===========================
step 4
buildSh2MF ProjectDIR/rt/sh_to_modulefile/path_both_ends.sh
===========================
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/debugger_2020/gdb/intel64/bin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/compilers_and_libraries_2020.0.166/linux/mpi/intel64/bin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/compilers_and_libraries_2020.0.166/linux/mpi/intel64/libfabric/bin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/compilers_and_libraries_2020.0.166/linux/bin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/compilers_and_libraries_2020.0.166/linux/bin/intel64")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/parallel_studio_xe_2020.0.088/bin/intel64")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/itac/2020.0.015/intel64/bin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/itac/2020.0.015/intel64/bin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/parallel_studio_xe_2020/bin64")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/parallel_studio_xe_2020/bin64")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/parallel_studio_xe_2020/bin64")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/intelpython3/condabin")
prepend_path("PATH","/scratch1/projects/compilers/intel20u0/intelpython3/bin")
append_path("PATH","/scratch1/projects/compilers/intel20u0/parallel_studio_xe_2020.0.088/bin")
===========================
step 5
buildSh2MF --from csh ProjectDIR/rt/sh_to_modulefile/cshScript.csh
===========================
setenv("FOO_BAR","1")
setenv("TST_SCRIPT","tst_script")
set_alias("fB","ls -aFC")
set_alias("fooBar","ls -aFC")
===========================
step 6
buildSh2MF ProjectDIR/rt/sh_to_modulefile/broken.sh
===========================
===========================
step 7
lua ProjectDIR/src/lmod.in.lua bash --regression_testing show wrapperSh/1.0
===========================
__LMOD_REF_COUNT_MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
===========================
step 8
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load wrapperSh/1.0
===========================
LOADEDMODULES=wrapperSh/1.0;
export LOADEDMODULES;
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
MY_NAME=tstScript.sh;
export MY_NAME;
__LMOD_REF_COUNT_PATH=ProjectDIR/rt/sh_to_modulefile/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1\;ProjectDIR/rt/sh_to_modulefile/sbin:1;
export __LMOD_REF_COUNT_PATH;
PATH=ProjectDIR/rt/sh_to_modulefile/bin:ProjectDIR/proj_mgmt:PATH_to_TM:ProjectDIR/rt/sh_to_modulefile/sbin;
export PATH;
SECOND=FOO_BAR;
export SECOND;
TST_SCRIPT=1;
export TST_SCRIPT;
_LMFILES_=ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
banner () {
    local str="$1";
    local RED='\\033[1;31m';
    local NONE='\\033[0m';
    echo "${RED}${str}${NONE}";
};
alias fooAlias=foobin\ -q\ -l;
fooFunc () {
    echo "arg1: $1";
};
junk () {
    if [ -n "${ZSH_VERSION:-}" ]; then
        \echo "junk";
    fi;
};
my_help () {
    echo "do not forget \"foo\"";
};
save_args () {
    for arg in "$@";
    do
        printf "%s\n" "$arg" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/' \\\\/";
    done;
    echo " ";
};
[[ -n "${BASH_VERSION:-}" ]] && complete -F _xyz123 xyz123;
===========================
step 9
lua ProjectDIR/src/lmod.in.lua bash --regression_testing show wrapperSh/1.0
===========================
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
===========================
step 10
lua ProjectDIR/src/lmod.in.lua bash --regression_testing refresh
===========================
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
banner () {
    local str="$1";
    local RED='\\033[1;31m';
    local NONE='\\033[0m';
    echo "${RED}${str}${NONE}";
};
alias fooAlias=foobin\ -q\ -l;
fooFunc () {
    echo "arg1: $1";
};
junk () {
    if [ -n "${ZSH_VERSION:-}" ]; then
        \echo "junk";
    fi;
};
my_help () {
    echo "do not forget \"foo\"";
};
save_args () {
    for arg in "$@";
    do
        printf "%s\n" "$arg" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/' \\\\/";
    done;
    echo " ";
};
[[ -n "${BASH_VERSION:-}" ]] && complete -F _xyz123 xyz123;
===========================
step 11
lua ProjectDIR/src/lmod.in.lua bash --regression_testing list
===========================
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
===========================
step 12
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --mt
===========================
===========================
step 13
lua ProjectDIR/src/lmod.in.lua bash --regression_testing unload wrapperSh/1.0
===========================
unset LOADEDMODULES;
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
unset MY_NAME;
__LMOD_REF_COUNT_PATH=ProjectDIR/proj_mgmt:1\;PATH_to_TM:1;
export __LMOD_REF_COUNT_PATH;
PATH=ProjectDIR/proj_mgmt:PATH_to_TM;
export PATH;
unset SECOND;
unset TST_SCRIPT;
unset _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
unset -f banner 2> /dev/null || true;
unalias fooAlias 2> /dev/null || true;
unset -f fooFunc 2> /dev/null || true;
unset -f junk 2> /dev/null || true;
unset -f my_help 2> /dev/null || true;
unset -f save_args 2> /dev/null || true;
[[ -n "${BASH_VERSION:-}" ]] && complete -r xyz123;
===========================
step 14
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load brokenSh/1.0
===========================
false
===========================
step 15
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load wrapperSh/1.0
===========================
LOADEDMODULES=wrapperSh/1.0;
export LOADEDMODULES;
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
MY_NAME=tstScript.sh;
export MY_NAME;
__LMOD_REF_COUNT_PATH=ProjectDIR/rt/sh_to_modulefile/bin:1\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1\;ProjectDIR/rt/sh_to_modulefile/sbin:1;
export __LMOD_REF_COUNT_PATH;
PATH=ProjectDIR/rt/sh_to_modulefile/bin:ProjectDIR/proj_mgmt:PATH_to_TM:ProjectDIR/rt/sh_to_modulefile/sbin;
export PATH;
SECOND=FOO_BAR;
export SECOND;
TST_SCRIPT=1;
export TST_SCRIPT;
_LMFILES_=ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
banner () {
    local str="$1";
    local RED='\\033[1;31m';
    local NONE='\\033[0m';
    echo "${RED}${str}${NONE}";
};
alias fooAlias=foobin\ -q\ -l;
fooFunc () {
    echo "arg1: $1";
};
junk () {
    if [ -n "${ZSH_VERSION:-}" ]; then
        \echo "junk";
    fi;
};
my_help () {
    echo "do not forget \"foo\"";
};
save_args () {
    for arg in "$@";
    do
        printf "%s\n" "$arg" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/' \\\\/";
    done;
    echo " ";
};
[[ -n "${BASH_VERSION:-}" ]] && complete -F _xyz123 xyz123;
===========================
step 16
lua ProjectDIR/src/lmod.in.lua bash --regression_testing save
===========================
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
===========================
step 17
lua ProjectDIR/src/lmod.in.lua bash --regression_testing restore
===========================
MODULEPATH=ProjectDIR/rt/sh_to_modulefile/mf;
export MODULEPATH;
MY_NAME=tstScript.sh;
export MY_NAME;
PATH=ProjectDIR/rt/sh_to_modulefile/bin:ProjectDIR/proj_mgmt:PATH_to_TM:ProjectDIR/rt/sh_to_modulefile/sbin;
export PATH;
SECOND=FOO_BAR;
export SECOND;
TST_SCRIPT=1;
export TST_SCRIPT;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={wrapperSh={fn="ProjectDIR/rt/sh_to_modulefile/mf/wrapperSh/1.0.lua",fullName="wrapperSh/1.0",loadOrder=1,mcmdT={["ProjectDIR/rt/sh_to_modulefile/second.sh arg1"]={"setenv(\"SECOND\",\"FOO_BAR\")",},["ProjectDIR/rt/sh_to_modulefile/tstScript.sh"]={"setenv(\"MY_NAME\",\"tstScript.sh\")","prepend_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/bin\")","append_path(\"PATH\",\"ProjectDIR/rt/sh_to_modulefile/sbin\")","setenv(\"TST_SCRIPT\",\"1\")","set_alias(\"fooAlias\",\"foobin -q -l\")",[[set_shell_function("banner"," \\ local str=\\"$1\\";\\ local RED='\\033[1;31m';\\ local NONE='\\033[0m';\\ echo \\"${RED}${str}${NONE}\\"\\","")]],[[set_shell_function("fooFunc"," \\ echo \\"arg1: $1\\"\\","")]],[[set_shell_function("junk"," \\ if [ -n \\"${ZSH_VERSION:-}\\" ]; then\\ \\\\echo \\"junk\\";\\ fi\\","")]],[[set_shell_function("my_help"," \\ echo \\"do not forget \\\\\\"foo\\\\\\"\\"\\","")]],[[set_shell_function("save_args"," \\ for arg in \\"$@\\";\\ do\\ printf \\"%s\\\\n\\" \\"$arg\\" | sed -e \\"s/'/'\\\\\\\\\\\\\\\\''/g\\" -e \\"1s/^/'/\\" -e \\"\\\\$s/\\\\$/' \\\\\\\\\\\\\\\\/\\";\\ done;\\ echo \\" \\"\\","")]],"complete(\"bash\",\"XyZ123\",\"-F _xyz123\")",},},propT={},stackDepth=0,status="active",userName="wrapperSh/1.0",wV="000000001.*zfinal",},},mpathA={"ProjectDIR/rt/sh_to_modulefile/mf",},systemBaseMPATH="ProjectDIR/rt/sh_to_modulefile/mf",}';
export _ModuleTable_;
__LMOD_DEFAULT_MODULES_LOADED__=1;
export __LMOD_DEFAULT_MODULES_LOADED__;
banner () {
    local str="$1";
    local RED='\\033[1;31m';
    local NONE='\\033[0m';
    echo "${RED}${str}${NONE}";
};
alias fooAlias=foobin\ -q\ -l;
fooFunc () {
    echo "arg1: $1";
};
junk () {
    if [ -n "${ZSH_VERSION:-}" ]; then
        \echo "junk";
    fi;
};
my_help () {
    echo "do not forget \"foo\"";
};
save_args () {
    for arg in "$@";
    do
        printf "%s\n" "$arg" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/' \\\\/";
    done;
    echo " ";
};
[[ -n "${BASH_VERSION:-}" ]] && complete -F _xyz123 xyz123;
===========================
step 18
lua ProjectDIR/src/lmod.in.lua bash --regression_testing --mt
===========================
===========================
step 19
lua ProjectDIR/src/lmod.in.lua bash --regression_testing load A
===========================
LOADEDMODULES=A/1.0;
export LOADEDMODULES;
__LMOD_REF_COUNT_MODULEPATH=OutputDIR/mf:1;
export __LMOD_REF_COUNT_MODULEPATH;
MODULEPATH=OutputDIR/mf;
export MODULEPATH;
__LMOD_REF_COUNT_PATH=ProjectDIR/rt/sh_to_modulefile/bin:2\;ProjectDIR/proj_mgmt:1\;PATH_to_TM:1\;ProjectDIR/rt/sh_to_modulefile/sbin:2;
export __LMOD_REF_COUNT_PATH;
PATH=ProjectDIR/rt/sh_to_modulefile/bin:ProjectDIR/proj_mgmt:PATH_to_TM:ProjectDIR/rt/sh_to_modulefile/sbin;
export PATH;
_LMFILES_=OutputDIR/mf/A/1.0;
export _LMFILES_;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={A={fn="OutputDIR/mf/A/1.0",fullName="A/1.0",loadOrder=1,propT={},stackDepth=0,status="active",userName="A",wV="000000001.*zfinal",},},mpathA={"OutputDIR/mf",},systemBaseMPATH="OutputDIR/mf",}';
export _ModuleTable_;
banner () {
    local str="$1";
    local RED='\\033[1;31m';
    local NONE='\\033[0m';
    echo "${RED}${str}${NONE}";
};
alias fooAlias=foobin\ -q\ -l;
fooFunc () {
    echo "arg1: $1";
};
junk () {
    if [ -n "${ZSH_VERSION:-}" ]; then
        \echo "junk";
    fi;
};
my_help () {
    echo "do not forget \"foo\"";
};
save_args () {
    for arg in "$@";
    do
        printf "%s\n" "$arg" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/' \\\\/";
    done;
    echo " ";
};
[[ -n "${BASH_VERSION:-}" ]] && complete -F _xyz123 xyz123;
===========================
step 20
lua ProjectDIR/src/lmod.in.lua bash --regression_testing list
===========================
MODULEPATH=OutputDIR/mf;
export MODULEPATH;
_ModuleTable_='_ModuleTable_={MTversion=3,depthT={},family={},mT={A={fn="OutputDIR/mf/A/1.0",fullName="A/1.0",loadOrder=1,propT={},stackDepth=0,status="active",userName="A",wV="000000001.*zfinal",},},mpathA={"OutputDIR/mf",},systemBaseMPATH="OutputDIR/mf",}';
export _ModuleTable_;
