From 569c2f7f70e33e414c5921fe43ecf9c05d7f7957 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 13 Nov 2008 19:11:32 +0100 Subject: fixes to run_background --- src/core/libs/lib-misc.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/core/libs/lib-misc.sh') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index f421af3..b85e151 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -17,12 +17,11 @@ run_background () touch /home/arch/fifa/runtime/$1-running debug "run_background starting $1: $2 >>$3 2>&1" [ -f $3 ] && echo -e "\n\n\n" >>$3 - echo "STARTING $1 . Executing $2 >>$3 2>&1" >> $3; \ - echo >> $3; \ - eval "$2" >>$3 2>&1 + echo "STARTING $1 . Executing $2 >>$3 2>&1\n" >> $3; var_exit=${1}_exitcode - read $var_exit <<< $? #TODO: bash complains about 'invalid key' or something iirc - debug "run_background done with $1: exitcode (\$$1_exitcode): "${!var_exit}" .Logfile $3" #TODO ${!var_exit} doesn't show anything + eval "$2" >>$3 2>&1 + read $var_exit <<< $? #TODO: bash complains about 'not a valid identifier' or something iirc -> maybe fixed now.. + debug "run_background done with $1: exitcode (\$$1_exitcode): "${!var_exit}" .Logfile $3" #TODO ${!var_exit} doesn't show anything --> maybe fixed now echo >> $3 rm -f /home/arch/fifa/runtime/$1-running ) & -- cgit v1.2.3-54-g00ecf