Test if a variable is an array.
is-array
tests if given variable is an array.
Test if given string is the name of a variable storing an array.
- $variable The variable to be tested.
source "${BASH_SOURCE[0]%/*}/libs/biapy-bashlings/src/is-array.bash"
example_list=( 'test' 'second text' 10 11 )
is-array 'example_list' && 'example_list is an array'
- $1 (string): The name of the variable checked to be an array.
- 0: If variable is a array.
- 1: If variable is not an array, or is not set.
- Display an error if $1 is missing.