run.sh: don't silently ignore a non-executable file argument
authorBrian Norris <banorris@uci.edu>
Wed, 10 Jul 2013 01:44:19 +0000 (18:44 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 10 Jul 2013 01:46:19 +0000 (18:46 -0700)
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.

run.sh

diff --git a/run.sh b/run.sh
index 00ffd94b338c223710f15198e06f1fd40ca25509..bb204ded5aee36760de7df0ea81b726a2c14cccf 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -17,7 +17,7 @@ PREFIX=
 export LD_LIBRARY_PATH=.
 
 [ $# -gt 0 ] && [ "$1" = "gdb" ] && PREFIX=gdb && shift
 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 $@
 $PREFIX $BIN $@