bin/isabelle-interface
author gagern
Wed Apr 20 19:00:30 2005 +0200 (2005-04-20)
changeset 15784 3a214de33d53
parent 15778 98af3693f6b3
child 15843 d5bd4a18ce70
permissions -rwxr-xr-x
removed redundant readlink call
     1 #!/usr/bin/env bash
     2 #
     3 # $Id$
     4 # Author: Markus Wenzel, TU Muenchen
     5 #
     6 # Isabelle interface startup script.
     7 
     8 
     9 ## settings
    10 
    11 PRG="$(basename "$0")"
    12 
    13 THIS="$0"
    14 while [ -L "$THIS" ]; do
    15     THIS="$(dirname "$THIS")/$(LC_ALL=C ls -l "$THIS" | sed 's/.* -> //')"
    16 done
    17 ISABELLE_HOME="$(cd "$(dirname "$THIS")/.."; pwd)"
    18 . "$ISABELLE_HOME/lib/scripts/getsettings" || \
    19   { echo "$PRG probably not called from its original place!"; exit 2; }
    20 
    21 
    22 ## diagnostics
    23 
    24 function fail()
    25 {
    26   echo "$1" >&2
    27   exit 2
    28 }
    29 
    30 
    31 ## main
    32 
    33 case "$ISABELLE_INTERFACE" in
    34   none)
    35     INTERFACE="$ISABELLE"
    36     ;;
    37   */*)
    38     INTERFACE="$ISABELLE_INTERFACE"
    39     ;;
    40   *)
    41     INTERFACE="$ISABELLE_HOME/lib/scripts/isa-$ISABELLE_INTERFACE"
    42     ;;
    43 esac
    44 
    45 [ ! -x "$INTERFACE" ] && fail "Bad Isabelle interface: \"$ISABELLE_INTERFACE\""
    46 
    47 exec "$INTERFACE" "$@"