summaryrefslogtreecommitdiffstats
path: root/scripts/run_regression
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-06-24 18:54:36 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-06-24 18:54:36 +0300
commitefcae8fa373bf0ea6ceac051a698f621d5d65aa1 (patch)
tree30cd7f8c13a7dc4ffc36dada241bf9839f55bca6 /scripts/run_regression
parentff5799ae624b6e74faf26e821558964a08f33577 (diff)
run_regression: fix passing argument with spaces
Diffstat (limited to 'scripts/run_regression')
-rwxr-xr-xscripts/run_regression9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/run_regression b/scripts/run_regression
index bdc2f185..407b7f84 100755
--- a/scripts/run_regression
+++ b/scripts/run_regression
@@ -1,6 +1,9 @@
#!/bin/bash
-INPUT_ARGS=${@//--python[23]/}
+ARGS=()
+for var in "$@"; do
+ [[ "$var" != '--python2' && "$var" != '--python3' ]] && ARGS+=("$var")
+done
if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then
source find_python.sh --python2
@@ -8,7 +11,7 @@ if [[ $@ =~ '--python2' || ! $@ =~ '--python3' ]]; then
# Python 2
echo Python2 test
- $PYTHON trex_unit_test.py $INPUT_ARGS
+ $PYTHON trex_unit_test.py "${ARGS[@]}"
if [ $? -eq 0 ]; then
printf "\n$PYTHON test succeeded\n\n"
else
@@ -24,7 +27,7 @@ if [[ $@ =~ '--python3' ]]; then
# Python 3
echo Python3 test
- $PYTHON trex_unit_test.py $INPUT_ARGS
+ $PYTHON trex_unit_test.py "${ARGS[@]}"
if [ $? -eq 0 ]; then
printf "\n$PYTHON test succeeded\n\n"
else