From 2e929c9e5abdab762687fd1c0034a3a0246eb050 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sun, 11 Aug 2019 06:22:54 -0700 Subject: [PATCH] fix GetLetter --- qndtmf.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qndtmf.sh b/qndtmf.sh index 5db5b4a..176501a 100755 --- a/qndtmf.sh +++ b/qndtmf.sh @@ -18,9 +18,11 @@ # We set this to spaces, it will be set later GetLetter () { + local i if [[ $1 == +([0-9]) ]]; then - if [ $1 -gt 0 ] && [ $1 -le 26 ]; then - LETTER=${LETTERS[$1-1]} + i=`expr $1 - 1` + if [ $i -ge 0 ] && [ $i -lt 26 ]; then + LETTER=${LETTERS[$i]} return fi fi