####NB THIS FILE TRANSLATED FROM poplogout TO SH/BASH

### This must be run using "source poplogout.sh", from bash or sh
### $poplocal/local/com/poplogout
#
# J. Meyer, Nov 1990
# A. Sloman, various modifications and extensions 30 Jun 2002
# poplogout - remove Poplog environment variables from environment
#
# usage: source poplogout


# UNSET PATH: remove $usepop, $poplocal, $popsys, $popcom  from path,
# including some likely repetitions, using this format
# PATH=${PATH/$homebin:/} to remove $homebin

PATH=${PATH/$usepop:/}
PATH=${PATH/$usepop:/}
PATH=${PATH/$poplocal:/}
PATH=${PATH/$poplocal:/}
PATH=${PATH/$popsys:/}
PATH=${PATH/$popsys:/}
PATH=${PATH/$popcom:/}
PATH=${PATH/$popcom:/}


echo $PATH


if [ -z "$usepop" ] ; then

    echo "usepop not set";
    return ;

else unset usepop;

fi

# BASIC UNSETS: remove variables listed in
##    usepop/pop/com/popenv.sh

for i in  \
        popcom \
        popsrc \
        popsys \
        popexternlib \
        popautolib \
        popdatalib \
        popliblib \
        poppwmlib \
        popsunlib \
        popvedlib \
        poplocalauto \
        poplocalbin \
        popsavelib \
        popcomppath \
        popsavepath \
        popexlinkbase \
        pop_ved      \
        pop_help     \
        pop_ref      \
        pop_teach    \
        pop_doc      \
        pop_im       \
        pop_eliza    \
        pop_prolog   \
        pop_clisp    \
        pop_pml      \
        pop_xved     \
        pop_xvedpro  \
        pop_xvedlisp \
        popcontrib   \
        pop_pop11    \
        pop_popc     \
        poplib       \
        pop_poplink  \
        popobjlib    \
        local        \
        pop_poplibr \
        usepop \
        poplocal ;

    do unset "$i"
done
