bin/isabelle-interface
author wenzelm
Sat Oct 04 16:19:00 2008 +0200 (2008-10-04)
changeset 28502 6b0e3e4e1891
parent 15980 3dfcdb19f242
permissions -rwxr-xr-x
replaced ISABELLE by ISABELLE_PROCESS;
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@28502
    35
    INTERFACE="$ISABELLE_PROCESS"
wenzelm@11550
    36
    ;;
wenzelm@11550
    37
  */*)
wenzelm@11550
    38
    INTERFACE="$ISABELLE_INTERFACE"
wenzelm@11550
    39
    ;;
wenzelm@11550
    40
esac
wenzelm@11550
    41
wenzelm@11550
    42
[ ! -x "$INTERFACE" ] && fail "Bad Isabelle interface: \"$ISABELLE_INTERFACE\""
wenzelm@11550
    43
wenzelm@11550
    44
exec "$INTERFACE" "$@"