src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version
author wenzelm
Tue, 16 Apr 2013 17:54:14 +0200
changeset 51709 19b47bfac6ef
parent 41952 c7297638599b
permissions -rwxr-xr-x
proper prolog command-line instead of hashbang, which might switch to invalid executable and thus fail (notably on lxbroy2); speculative update for yap (untested);

#!/usr/bin/env bash
#
# Author: Lukas Bulwahn, TU Muenchen, 2010
#
# Determine SWI-Prolog version

if [ "$ISABELLE_SWIPL" != "" ]; then
  VERSION="$("$ISABELLE_SWIPL" --version)"
  REGEXP='^SWI-Prolog version ([0-9\.]*) for .*$'
  if [[ "$VERSION" =~ $REGEXP ]]; then
    echo -n "${BASH_REMATCH[1]}"
  else
    echo -n undefined
  fi
fi