source: trunk/gsdl/setup.bash@ 2749

Last change on this file since 2749 was 2749, checked in by jrm21, 23 years ago

fixed a typo in comment.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1# if this file is executed, /bin/sh is used, as we don't start with #!
2# this should work under ash, bash, zsh, ksh, sh style shells.
3
4# make sure we are sourced, and not run
5
6if test "$0" != "`echo $0 | sed s/setup\.bash//`" ; then
7# if $0 contains "setup.bash" we've been run... $0 is shellname if sourced.
8# One exception is zsh has an option to set it temporarily to the script name
9 if test -z "$ZSH_NAME" ; then
10 # we aren't using zsh
11 gsdl_not_sourced=true
12 fi
13fi
14
15if test -n "$gsdl_not_sourced" ; then
16 echo " Error: Make sure you source this script, not execute it. Eg:"
17 echo " $ source setup.bash"
18 echo " or"
19 echo " $ . ./setup.bash"
20 echo " not"
21 echo " $ ./setup.bash"
22elif test -n "$GSDLHOME" ; then
23 echo "Your environment is already set up for Greenstone!"
24elif test ! -f setup.bash ; then
25 echo "You must source the script from within the Greenstone home directory"
26else
27 export GSDLHOME=`pwd`
28 export GSDLOS=`uname -s | tr A-Z a-z`
29 # check for running bash under cygwin
30 if test "`echo $GSDLOS | sed 's/cygwin//'`" != "$GSDLOS" ;
31 then
32 GSDLOS=windows
33 fi
34 export PATH=$PATH:$GSDLHOME/bin/script:$GSDLHOME/bin/$GSDLOS
35 export MANPATH=$MANPATH:$GSDLHOME/packages/mg/man
36 echo "Your environment has successfully been set up to run Greenstone"
37fi
38unset gsdl_not_sourced
Note: See TracBrowser for help on using the repository browser.