From 9211d8b3dba78e03e09ee56d839e392fc13bf1c0 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 21 Jul 2007 22:35:34 +0000 Subject: Work around a bash evaluation error --- net.Linux/iwconfig.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/net.Linux/iwconfig.sh b/net.Linux/iwconfig.sh index c29046e5..4c2dccce 100644 --- a/net.Linux/iwconfig.sh +++ b/net.Linux/iwconfig.sh @@ -422,20 +422,21 @@ iwconfig_scan() { # Strip any duplicates local i=0 k=1 a= b= while [ ${i} -lt ${APS} ] ; do - k=$((${i} + 1)) - while [ ${k} -le ${APS} ] ; do + k=$((${i} + 1)) + while [ ${k} -le ${APS} ] ; do eval a=\$MAC_${i} eval b=\$MAC_${k} if [ "${a}" = "${b}" ] ; then - eval a=\$QUALITY_${i} - eval b=\$QUALITY_${k} + eval a=\$QUALITY_${i} + eval b=\$QUALITY_${k} local u=${k} - [ -n "${a}" -a -n "${b}" -a "${a}" -lt "${b}" ] && u=${i} + # We need to split this into two tests, otherwise bash errors + [ -n "${a}" -a -n "${b}" ] && [ "${a}" -lt "${b}" ] && u=${i} unset MAC_${u} SSID_${u} CHAN_${u} QUALITY_${u} ENC_${u} fi k=$((${k} + 1)) - done - i=$((${i} + 1)) + done + i=$((${i} + 1)) done local i=0 e= m= black= s= -- cgit v1.2.3