From ae92acdfcbbd8959b5ba512d540bd4ca118629a2 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 6 Oct 2011 18:00:59 -0500 Subject: quote individual elements for the validation string --- etc/bash_completion.d/vyatta-cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 2ee8edc..96cc555 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -724,7 +724,13 @@ vyatta_config_invalid_comp () local path='' local opath='' local failed=false - local validate="cli-shell-api validateTmplPath -- $editlvl '${expanded_api_args[@]:1}'" + local validate="cli-shell-api validateTmplPath -- $editlvl" + for elem in "${expanded_api_args[@]:1}"; do + if [[ -z "$elem" ]]; then + continue + fi + validate="$validate '$elem'" + done eval $validate local validateret=$? if [[ $validateret -eq 0 ]]; then -- cgit v1.2.3