From 5de548e5ee8fd5fc9873963ae4a9d477b2bfdcb3 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 6 Oct 2011 16:20:12 -0500 Subject: Bugfix 6747: use bash conditional expressions instead of posix test expressions when doing comparisons. The conditional expressions don't do as much expansion as the test expression does, and are the modern variant --- functions/interpreter/vyatta-common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functions/interpreter') diff --git a/functions/interpreter/vyatta-common b/functions/interpreter/vyatta-common index 0a98d56..c6e645f 100644 --- a/functions/interpreter/vyatta-common +++ b/functions/interpreter/vyatta-common @@ -34,7 +34,7 @@ get_prefix_filtered_list () local idx=0 for elem in "${olist[@]}"; do local sub=${elem#$pfx} - if [ "$elem" == "$sub" ] && [ -n "$pfx" ]; then + if [[ "$elem" == "$sub" ]] && [[ -n "$pfx" ]]; then continue fi eval "$3[$idx]=\"$elem\"" @@ -60,7 +60,7 @@ get_prefix_filtered_list2 () eval "local elem=\${$2[$orig_idx]}" eval "local elem2=\${$4[$orig_idx]}" local sub=${elem#$pfx} - if [ "$elem" == "$sub" ] && [ -n "$pfx" ]; then + if [[ "$elem" == "$sub" ]] && [[ -n "$pfx" ]]; then continue fi eval "$3[$idx]=\"$elem\"" -- cgit v1.2.3