Author: aconway
Date: Thu Jan 24 06:25:02 2008
New Revision: 614880

URL: http://svn.apache.org/viewvc?rev=614880&view=rev
Log:
Fix error in script - not passing $ARGS to background processes.

Modified:
    incubator/qpid/trunk/qpid/cpp/examples/verify

Modified: incubator/qpid/trunk/qpid/cpp/examples/verify
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/examples/verify?rev=614880&r1=614879&r2=614880&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/examples/verify (original)
+++ incubator/qpid/trunk/qpid/cpp/examples/verify Thu Jan 24 06:25:02 2008
@@ -6,15 +6,19 @@
 DIR=$PWD
 SRC=`dirname $0 | sed 's|^\([^/].*\)|'$PWD'/\1|'`/examples
 
-# Kill any leftover background jobs.
-trap "kill %% > /dev/null 2>&1"  EXIT
-
 # Start private broker if QPIDD is set.
 if [ -n "$QPIDD" ] ; then
     export QPID_PORT=`$QPIDD -dp0` || { echo "Cannot start $QPIDD" ; exit 1; }
     trap "$QPIDD -q" EXIT
 fi
 
+cleanup() {
+    test -n "$QPIDD" &&  $QPIDD -q # Private broker
+    kill %% > /dev/null 2>&1   # Leftover background jobs
+}
+
+trap cleanup EXIT
+
 ARGS="${QPID_HOST:-localhost} $QPID_PORT"
 
 
@@ -25,7 +29,7 @@
 
 background() {
     pattern=$1; shift
-    "$@" > $1.out &
+    eval "$@ $ARGS > $1.out &"
     waitfor $1.out $pattern
 }
 


Reply via email to