Next: , Previous: , Up: Top   [Contents][Index]


18 Manipulating arrays

Function: mbfl_array_is_empty ARRAY_VARNAME

Return successfully if the array is empty.

local -a ARRY
mbfl_array_is_empty ARRY        ⇒ 0
ARRY=(a b c)
mbfl_array_is_empty ARRY        ⇒ 1
Function: mbfl_array_is_not_empty ARRAY_VARNAME

Return successfully if the array is not empty.

local -a ARRY
mbfl_array_is_not_empty ARRY    ⇒ 1
ARRY=(a b c)
mbfl_array_is_not_empty ARRY    ⇒ 0
Function: mbfl_array_length ARRAY_VARNAME
Function: mbfl_array_length_var _RV ARRAY_VARNAME

Print the number of pairs in the array.

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.

local -a ARRY
mbfl_array_length ARRY          -| 0
ARRY=(a b c)
mbfl_array_length ARRY          -| 3

local _RV
mbfl_array_length_var _RV ARRY
"$_RV"   -| 3

Next: , Previous: , Up: Top   [Contents][Index]

This document describes version 3.0.0-devel.0 of Marcos Bash Functions Library.