Revision 965

trunk/scripts/admb/admb (revision 965)
16 16
fi
17 17

  
18 18
FILE=$0
19
DIRECTORY=$(cd `dirname $FILE` && pwd)
19 20
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
21
  pushd $DIRECTORY &> /dev/null
22
  FILE=$(readlink $DIRECTORY/admb)
23
  DIRECTORY=$(cd `dirname $FILE` && pwd)
28 24
  popd &> /dev/null
29 25
done
30

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

Also available in: Unified diff