12
12
# for indexed arrays, $_i_[arr_name]_h_index variable holds the highest index in the array if it's known
13
13
14
14
15
- # unsets all variables used to store the array
15
+ # unsets all variables used to store an indexed array
16
16
# 1 - array name
17
17
unset_i_arr () {
18
18
___me=" unset_i_arr"
@@ -24,6 +24,7 @@ unset_i_arr() {
24
24
eval " _i_${_arr_name} _sorted_flag=0"
25
25
}
26
26
27
+ # backend function
27
28
# unsets all variables of an indexed array
28
29
# 1 - array name
29
30
do_unset_i_arr () {
@@ -310,8 +311,7 @@ get_i_arr_max_index() {
310
311
fi
311
312
fi
312
313
313
- eval " _i_${_arr_name} _h_index" =' $_h_index' "
314
- $_out_var " =' $_h_index'
314
+ eval " _i_${_arr_name} _h_index" =' $_h_index' " $_out_var " =' $_h_index'
315
315
316
316
return 0
317
317
}
@@ -404,7 +404,7 @@ get_i_arr_val() {
404
404
}
405
405
406
406
407
- # unsets all variables used to store the array
407
+ # unsets all variables used to store an associative array
408
408
# 1 - array name
409
409
unset_a_arr () {
410
410
___me=" get_a_arr_val"
@@ -417,6 +417,7 @@ unset_a_arr() {
417
417
eval " _a_${_arr_name} _sorted_flag=0"
418
418
}
419
419
420
+ # backend function
420
421
# unsets all variables of an associative array
421
422
# 1 - array name
422
423
do_unset_a_arr () {
@@ -613,6 +614,7 @@ get_a_arr_val() {
613
614
eval " $_out_var " =' ${___val#"${_el_set_flag}"}'
614
615
}
615
616
617
+ # # Backend functions
616
618
617
619
check_strings () {
618
620
case " $1$2$3 " in * [!A-Za-z0-9_]* )
@@ -627,6 +629,7 @@ check_index() { case "$_index" in *[!0-9]* ) echo "$___me: Error: '$_index' is n
627
629
check_pair () { case " $___pair " in * =* ) ;; * ) echo " $___me : Error: '$___pair ' is not a 'key=value' pair." >&2 ; return 1; esac ; }
628
630
wrongargs () { echo " $___me : Error: '$* ': wrong number of arguments '$# '." >&2 ; }
629
631
632
+ # # Constants
630
633
631
634
___newline="
632
635
"
0 commit comments