bin/isabelle-interface
author wenzelm
Tue May 17 09:58:40 2005 +0200 (2005-05-17)
changeset 15967 f9163c6f69d6
parent 15864 cc1b4a289321
child 15980 3dfcdb19f242
permissions -rwxr-xr-x
proper treatment of directory links;
tuned;
wenzelm@11550
     1
#!/usr/bin/env bash
wenzelm@11550
     2
#
wenzelm@11550
     3
# $Id$
wenzelm@11550
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm@11550
     5
#
wenzelm@11550
     6
# Isabelle interface startup script.
wenzelm@11550
     7
wenzelm@15843
     8
if [ -L "$0" ]; then
wenzelm@15843
     9
  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
wenzelm@15967
    10
  exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
wenzelm@15843
    11
fi
wenzelm@15843
    12
wenzelm@11550
    13
wenzelm@11550
    14
## settings
wenzelm@11550
    15
wenzelm@11550
    16
PRG="$(basename "$0")"
wenzelm@11550
    17
wenzelm@15967
    18
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
wenzelm@15967
    19
source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
wenzelm@11550
    20
wenzelm@11550
    21
wenzelm@11550
    22
## diagnostics
wenzelm@11550
    23
wenzelm@11550
    24
function fail()
wenzelm@11550
    25
{
wenzelm@11550
    26
  echo "$1" >&2
wenzelm@11550
    27
  exit 2
wenzelm@11550
    28
}
wenzelm@11550
    29
wenzelm@11550
    30
wenzelm@11550
    31
## main
wenzelm@11550
    32
wenzelm@11550
    33
case "$ISABELLE_INTERFACE" in
wenzelm@11550
    34
  none)
wenzelm@11550
    35
    INTERFACE="$ISABELLE"
wenzelm@11550
    36
    ;;
wenzelm@11550
    37
  */*)
wenzelm@11550
    38
    INTERFACE="$ISABELLE_INTERFACE"
wenzelm@11550
    39
    ;;
wenzelm@11550
    40
  *)
wenzelm@11550
    41
    INTERFACE="$ISABELLE_HOME/lib/scripts/isa-$ISABELLE_INTERFACE"
wenzelm@11550
    42
    ;;
wenzelm@11550
    43
esac
wenzelm@11550
    44
wenzelm@11550
    45
[ ! -x "$INTERFACE" ] && fail "Bad Isabelle interface: \"$ISABELLE_INTERFACE\""
wenzelm@11550
    46
wenzelm@11550
    47
exec "$INTERFACE" "$@"