diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-10-06 16:20:12 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-10-06 16:20:12 -0500 |
commit | 12336898f7f0424955e9333df5da536a36278a59 (patch) | |
tree | b9aeb4c67aa5789008ac30ca0df23c7e85e6ca55 | |
parent | c89b93c2a4068b9dfde8c4f8b2b7e28ac3140d69 (diff) | |
download | vyatta-op-12336898f7f0424955e9333df5da536a36278a59.tar.gz vyatta-op-12336898f7f0424955e9333df5da536a36278a59.zip |
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
-rw-r--r-- | etc/bash_completion.d/vyatta-op | 2 | ||||
-rw-r--r-- | functions/interpreter/vyatta-common | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/etc/bash_completion.d/vyatta-op b/etc/bash_completion.d/vyatta-op index 48074dd..815b264 100644 --- a/etc/bash_completion.d/vyatta-op +++ b/etc/bash_completion.d/vyatta-op @@ -514,7 +514,7 @@ _vyatta_pipe_completion () _vyatta_pipe_noncompletions=() for word in "$@"; do - if [ "$found" == "1" -o "$word" == "|" ]; then + if [[ "$found" == "1" || "$word" == "|" ]]; then pipe_cmd+=( "$word" ) found=1 fi 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\"" |