# if this file is executed, /bin/sh is used, as we don't start with #! # this should work under ash, bash, zsh, ksh, sh style shells. # make sure we are sourced, and not run if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then # if $0 contains "setup.bash" we've been run... $0 is shellname if sourced. # One exception is zsh has an option to set it temporarily to the script name if test -z "$ZSH_NAME" ; then # we aren't using zsh gsdl_not_sourced=true fi fi if test -n "$gsdl_not_sourced" ; then echo " Error: Make sure you source this script, not execute it. Eg:" echo " $ source setup.bash" echo " or" echo " $ . ./setup.bash" echo " not" echo " $ ./setup.bash" elif test -n "$GSDLHOME" ; then echo "Your environment is already set up for Greenstone!" elif test ! -f setup.bash ; then echo "You must source the script from within the Greenstone home directory" else GSDLHOME=`pwd` export GSDLHOME GSDLOS=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # check for running bash under cygwin if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ; then GSDLOS=windows fi export GSDLOS PATH=$PATH:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS export PATH MANPATH=$MANPATH:$GSDLHOME/packages/mg/man export MANPATH echo "Your environment has successfully been set up to run Greenstone" fi unset gsdl_not_sourced