Revision 949 trunk/scripts/admb/admb

admb (revision 949)
11 11
if [[ "$1" == "-help" ]]; then help; exit; fi
12 12
if [[ "$1" == "--help" ]]; then help; exit; fi
13 13

  
14
if [ -z $ADMB_HOME ]; then
15
  FILE=$0
16
  while [ -h ${FILE} ]; do 
17
    BASENAME=$(basename $FILE)
18
    DIRNAME=$(dirname $FILE)
19
    pushd $DIRNAME &> /dev/null
20
    FILE="$PWD/$BASENAME"
21
    FILE=$(readlink $FILE)
22
    if [ ! "$FILE" == "/*" -a ! "$FILE" == "~/*" ]; then
23
      FILE="$PWD/$FILE"
24
    fi
25
    popd &> /dev/null
26
  done
14
if [ ! -z $ADMB_HOME ]; then
15
unset ADMB_HOME
16
fi
27 17

  
28
  pushd "$(dirname $FILE)/../" &> /dev/null
29
  declare -rx ADMB_HOME="$PWD"
18
FILE=$0
19
while [ -h ${FILE} ]; do 
20
  BASENAME=$(basename $FILE)
21
  DIRNAME=$(dirname $FILE)
22
  pushd $DIRNAME &> /dev/null
23
  FILE="$PWD/$BASENAME"
24
  FILE=$(readlink $FILE)
25
  if [ ! "$FILE" == "/*" -a ! "$FILE" == "~/*" ]; then
26
    FILE="$PWD/$FILE"
27
  fi
30 28
  popd &> /dev/null
31
  PATH=$ADMB_HOME/bin:$PATH
32
fi
29
done
33 30

  
31
pushd "$(dirname $FILE)/../" &> /dev/null
32
declare -rx ADMB_HOME="$PWD"
33
popd &> /dev/null
34
PATH=$ADMB_HOME/bin:$PATH
35

  
34 36
# Pop args until model=$1
35 37
unset bounds
36 38
unset d

Also available in: Unified diff