aboutsummaryrefslogtreecommitdiffhomepage
path: root/isa
diff options
context:
space:
mode:
authorGravatar Makarius Wenzel <makarius@sketis.net>2000-11-21 18:18:57 +0000
committerGravatar Makarius Wenzel <makarius@sketis.net>2000-11-21 18:18:57 +0000
commitd6d7a0be9aa3c56917b7d956b322953b5305506e (patch)
tree73a94db2dc5c7946b82746c702d47e1caa191841 /isa
parenta51550f20684e07ecf98fe8c7a0fb78ea0953163 (diff)
converted from sh back to bash;
use "#!/usr/bin/env bash" as interpreter to determine bash from PATH; handle spaces in file names;
Diffstat (limited to 'isa')
-rw-r--r--isa/interface33
1 files changed, 19 insertions, 14 deletions
diff --git a/isa/interface b/isa/interface
index 3c7c4282..ca591b24 100644
--- a/isa/interface
+++ b/isa/interface
@@ -1,14 +1,14 @@
-#!/bin/sh
+#!/usr/bin/env bash
#
# $Id$
#
# Proof General interface wrapper for Isabelle.
-
+set -x
## self references
-THIS=`cd \`dirname "$0"\`; pwd`
-SUPER=`cd "$THIS/.."; pwd`
-KIND=`basename \`dirname "$0"\``
+THIS=$(cd "$(dirname "$0")"; pwd)
+SUPER=$(cd "$THIS/.."; pwd)
+KIND=$(basename "$(dirname "$0")")
if [ "$KIND" = isar ]; then
ISAR=true
@@ -95,8 +95,8 @@ getoptions()
getoptions $PROOFGENERAL_OPTIONS
-getoptions $*
-shift `expr $OPTIND - 1`
+getoptions "$@"
+shift $(($OPTIND - 1))
if [ "$ISAR" = true ]; then
KIND=isar
@@ -109,10 +109,15 @@ fi
# args
-FILES="$@"
-shift "$#"
-
-[ -z "$FILES" ] && FILES="$DEFAULT_FILES"
+if [ "$#" -eq 0 ]; then
+ FILES="$DEFAULT_FILES"
+else
+ FILES=""
+ while [ "$#" -gt 0 ]; do
+ FILES="$FILES '$1'"
+ shift
+ done
+fi
## main
@@ -132,12 +137,12 @@ fi
[ ! "$XSYMBOLSETUP" = true ] && XSYMBOL_HOME=""
-ARGS="$ARGS -l $SUPER/isa/interface-setup.el"
+ARGS="$ARGS -l '$SUPER/isa/interface-setup.el'"
for FILE in "$ISABELLE_HOME/etc/proofgeneral-settings.el" \
"$ISABELLE_HOME_USER/etc/proofgeneral-settings.el"
do
- [ -f "$FILE" ] && ARGS="$ARGS -l $FILE"
+ [ -f "$FILE" ] && ARGS="$ARGS -l '$FILE'"
done
PROOFGENERAL_HOME="$SUPER"
@@ -147,4 +152,4 @@ PROOFGENERAL_XSYMBOL="$XSYMBOL"
export PROOFGENERAL_HOME PROOFGENERAL_ASSISTANTS PROOFGENERAL_LOGIC PROOFGENERAL_XSYMBOL
-exec $PROGNAME $ARGS $FILES
+eval exec "$PROGNAME" "$ARGS" "$FILES"