From: Brian Norris <banorris@uci.edu>
Date: Wed, 10 Jul 2013 01:44:19 +0000 (-0700)
Subject: run.sh: don't silently ignore a non-executable file argument
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9e091f7017e3e22742b26f991f8f06bc2fb874f4;p=cdsspec-compiler.git

run.sh: don't silently ignore a non-executable file argument

If we use a file which exists but is not executable as an argument to
run.sh, run.sh will silently ignore it. This is wrong.

Instead, just check for existence of the file (or directory), and error
out with a "Permission denied" message later, when we try to run it.
---

diff --git a/run.sh b/run.sh
index 00ffd94..bb204de 100755
--- a/run.sh
+++ b/run.sh
@@ -17,7 +17,7 @@ PREFIX=
 export LD_LIBRARY_PATH=.
 
 [ $# -gt 0 ] && [ "$1" = "gdb" ] && PREFIX=gdb && shift
-[ $# -gt 0 ] && [ -x "$1" ] && [ -f "$1" ] && BIN="$1" && shift
+[ $# -gt 0 ] && [ -e "$1" ] && BIN="$1" && shift
 
-set -x
+set -xe
 $PREFIX $BIN $@