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;
     1 #!/usr/bin/env bash
     2 #
     3 # $Id$
     4 # Author: Markus Wenzel, TU Muenchen
     5 #
     6 # Isabelle interface startup script.
     7 
     8 if [ -L "$0" ]; then
     9   TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
    10   exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
    11 fi
    12 
    13 
    14 ## settings
    15 
    16 PRG="$(basename "$0")"
    17 
    18 ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
    19 source "$ISABELLE_HOME/lib/scripts/getsettings" || 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" "$@"