summaryrefslogtreecommitdiff
path: root/src/core/libs/lib-misc.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-02-28 18:43:37 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-02-28 18:43:37 +0100
commitdebbad71e110d7a39a1115ca4d954173137b959b (patch)
tree64b5940d5522ad6304481c56fe60541ae40b7437 /src/core/libs/lib-misc.sh
parent031b0a3936898a64976ba06fb2c8bb242fac046e (diff)
fix for bash read: not a valid identifier, and hence, got rid of the pacman install pkg workaround (finally!!)
Diffstat (limited to 'src/core/libs/lib-misc.sh')
-rw-r--r--src/core/libs/lib-misc.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh
index d0ad3f0..ef7a000 100644
--- a/src/core/libs/lib-misc.sh
+++ b/src/core/libs/lib-misc.sh
@@ -3,7 +3,7 @@
# run a process in the background, and log it's stdout and stderr to a specific logfile
# returncode is stored in $<identifier>_exitcode
-# $1 identifier
+# $1 identifier -> WARNING: do never ever use -'s or other fancy characters here. only numbers, letters and _ please. (because $<identifier>_exitcode must be a valid bash variable!)
# $2 command (will be eval'ed)
# $3 logfile
run_background ()
@@ -20,8 +20,8 @@ run_background ()
echo "STARTING $1 . Executing $2 >>$3 2>&1\n" >> $3;
var_exit=${1}_exitcode
eval "$2" >>$3 2>&1
- read $var_exit <<< $? #TODO: bash complains about 'not a valid identifier'
- debug 'MISC' "run_background done with $1: exitcode (\$$1_exitcode): ${!var_exit} .Logfile $3" #TODO ${!var_exit} doesn't show anything --> maybe fixed now
+ read $var_exit <<< $?
+ debug 'MISC' "run_background done with $1: exitcode (\$$1_exitcode): ${!var_exit} .Logfile $3"
echo >> $3
rm -f $RUNTIME_DIR/aif-$1-running
) &
@@ -31,7 +31,7 @@ run_background ()
# wait until a process is done
-# $1 identifier
+# $1 identifier. WARNING! see above
wait_for ()
{
[ -z "$1" ] && die_error "wait_for needs an identifier to known on which command to wait!"