diff options
author | Martin Schaller <martin.schaller@it-schaller.de> | 2014-05-08 15:11:53 -0700 |
---|---|---|
committer | Martin Schaller <martin.schaller@it-schaller.de> | 2014-05-08 15:11:53 -0700 |
commit | bc4ace81dae0fecb4824d1e2ad0141656cce2b21 (patch) | |
tree | 92d2fcf55b4287b18ffb63830380f6c1bbbdb667 /src | |
parent | 9c579808f4eccfa4ab3c39f0794aa9addaff3f2b (diff) | |
download | poi-service-bc4ace81dae0fecb4824d1e2ad0141656cce2b21.tar.gz |
Add option to generate subprocess log file
Diffstat (limited to 'src')
-rwxr-xr-x | src/navigation/script/run | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/navigation/script/run b/src/navigation/script/run index d456020..726705b 100755 --- a/src/navigation/script/run +++ b/src/navigation/script/run @@ -28,12 +28,14 @@ function run { local x=$xterm local g=$gdb + local l=$log local title="$1" shift if [ "$1" = "-n" ] then shift x=0 + log=0 fi if [ "$1" = -"g" ] then @@ -47,6 +49,9 @@ function run set -- gdb -ex run --args "$@" fi xterm -T "$title" -sb -sl 5000 -e "$@" & + elif [ "$log" = 1 ] + then + "$@" >"$CUR_DIR/$title.log" 2>&1 & else "$@" & fi @@ -62,11 +67,13 @@ function terminate gdb=0 xterm=0 +log=0 enhpos=1 center="4612 N 0608 E" +CUR_DIR=$PWD BIN_DIR=$PWD/../bin SRC_DIR=$PWD/.. -while getopts b:c:gnx opt +while getopts b:c:gnox opt do case $opt in b) @@ -95,6 +102,9 @@ do n) enhpos=0 ;; + o) + log=1 + ;; x) xterm=1 ;; |