Browse Source

Few fixes for shellcheck

Ondrej Simek 7 years ago
parent
commit
577380e98e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      dnsapi/dns_he.sh

+ 4 - 4
dnsapi/dns_he.sh

@@ -154,7 +154,7 @@ _find_zone() {
 
 
     _debug "Zone \"$_attempted_zone\" doesn't exist, let's try a less" \
     _debug "Zone \"$_attempted_zone\" doesn't exist, let's try a less" \
       "specific zone."
       "specific zone."
-    _strip_counter=$(_math $_strip_counter + 1)
+    _strip_counter=$(_math "$_strip_counter" + 1)
   done
   done
 }
 }
 
 
@@ -171,11 +171,11 @@ _find_zone() {
 
 
 _find_linenum() {
 _find_linenum() {
   _current_line_num=0
   _current_line_num=0
-  while read line; do
-    _current_line_num=$(expr "$_current_line_num" + 1)
+  while read -r line; do
+    _current_line_num=$(_math "$_current_line_num" + 1)
     if [ "$line" = "$1" ]; then
     if [ "$line" = "$1" ]; then
       # Found! Let's echo the line number and quit
       # Found! Let's echo the line number and quit
-      echo $_current_line_num
+      echo "$_current_line_num"
       return 0
       return 0
     fi
     fi
   done
   done