diff rDiff/bin/start_interpreter.sh @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rDiff/bin/start_interpreter.sh	Thu Feb 14 23:38:36 2013 -0500
@@ -0,0 +1,24 @@
+#/bin/bash
+set -e
+
+. `dirname $0`/rdiff_config.sh
+
+export MATLAB_RETURN_FILE=`mktemp -t rDiff.XXXXXXXXXX.tmp` 
+
+
+if [ "$RDIFF_INTERPRETER" == 'octave' ];
+then
+	echo exit | ${RDIFF_OCTAVE_BIN_PATH} --no-window-system -q --eval "global SHELL_INTERPRETER_INVOKE; SHELL_INTERPRETER_INVOKE=1; warning('off', 'Octave:shadowed-function'); warning('off', 'Octave:deprecated-function') ; addpath $RDIFF_SRC_PATH;  $1('$2'); exit;" || (echo starting Octave failed; rm -f $MATLAB_RETURN_FILE; exit -1) ;
+fi
+
+if [ "$RDIFF_INTERPRETER" == 'matlab' ];
+then
+	echo exit | ${RDIFF_MATLAB_BIN_PATH} -nodisplay -r "global SHELL_INTERPRETER_INVOKE; SHELL_INTERPRETER_INVOKE=1; addpath $RDIFF_SRC_PATH;  $1('$2'); exit;" || (echo starting Matlab failed; rm -f $MATLAB_RETURN_FILE; exit -1) ;
+fi
+
+test -f $MATLAB_RETURN_FILE || exit 0
+ret=`cat $MATLAB_RETURN_FILE` ;
+rm -f $MATLAB_RETURN_FILE
+exit $ret
+
+