bin/isabelle-interface
author wenzelm
Thu, 28 Aug 2008 19:29:56 +0200
changeset 28043 4d05f04cc671
parent 15980 3dfcdb19f242
child 28502 6b0e3e4e1891
permissions -rwxr-xr-x
refined option -W: output stream;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11550
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     2
#
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     3
# $Id$
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     5
#
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     6
# Isabelle interface startup script.
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
     7
15843
d5bd4a18ce70 improved handling of symlinks;
wenzelm
parents: 15784
diff changeset
     8
if [ -L "$0" ]; then
d5bd4a18ce70 improved handling of symlinks;
wenzelm
parents: 15784
diff changeset
     9
  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
15967
f9163c6f69d6 proper treatment of directory links;
wenzelm
parents: 15864
diff changeset
    10
  exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
15843
d5bd4a18ce70 improved handling of symlinks;
wenzelm
parents: 15784
diff changeset
    11
fi
d5bd4a18ce70 improved handling of symlinks;
wenzelm
parents: 15784
diff changeset
    12
11550
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    13
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    14
## settings
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    15
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    16
PRG="$(basename "$0")"
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    17
15967
f9163c6f69d6 proper treatment of directory links;
wenzelm
parents: 15864
diff changeset
    18
ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
f9163c6f69d6 proper treatment of directory links;
wenzelm
parents: 15864
diff changeset
    19
source "$ISABELLE_HOME/lib/scripts/getsettings" || exit 2
11550
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    20
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    21
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    22
## diagnostics
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    23
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    24
function fail()
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    25
{
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    26
  echo "$1" >&2
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    27
  exit 2
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    28
}
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    29
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    30
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    31
## main
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    32
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    33
case "$ISABELLE_INTERFACE" in
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    34
  none)
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    35
    INTERFACE="$ISABELLE"
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    36
    ;;
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    37
  */*)
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    38
    INTERFACE="$ISABELLE_INTERFACE"
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    39
    ;;
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    40
esac
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    41
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    42
[ ! -x "$INTERFACE" ] && fail "Bad Isabelle interface: \"$ISABELLE_INTERFACE\""
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    43
915c5de6480f smart selection of isabelle-process versus isabelle-interface;
wenzelm
parents:
diff changeset
    44
exec "$INTERFACE" "$@"