X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=run.sh;h=d4bf03000c92d6ab01f39b0e4cd14a17643f091f;hp=7ef8e9bcf00193c1e44c9243bec39cefd754d25b;hb=0217e321ae9bb43b3e629fdb400d6f1c41fb75f0;hpb=c77d1d922ed975933eab0b527c2c2e2951b64174 diff --git a/run.sh b/run.sh index 7ef8e9b..d4bf030 100755 --- a/run.sh +++ b/run.sh @@ -1,13 +1,24 @@ #!/bin/sh +# +# Runs a simple test (default: ./test/userprog.o) +# Syntax: +# ./run.sh [gdb] +# ./run.sh [test program] [gdb] +# +# If you include a 'gdb' argument, the your program will be launched with gdb. +# You can also supply a test program argument to run something besides the +# default program. +# + +BIN=./test/userprog.o + export LD_LIBRARY_PATH=. -if [ $# -gt 0 ]; then - if [ "$1" = "gdb" ]; then - gdb ./model - else - echo "Invalid argument(s)" - exit 1 - fi -else - ./model +[ $# -gt 0 ] && [ "$1" != "gdb" ] && BIN=$1 && shift + +if [ $# -gt 0 ] && [ "$1" = "gdb" ]; then + shift + gdb $BIN $@ fi + +$BIN $@