This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
bash-shell-base/modules/utility/helpers.mod

14 lines
269 B
Modula-2
Raw Normal View History

#!/bin/bash
# must be json as a string, depends on jq
get_prop_value () {
local value
# echo in $1 get $2
value=$(echo $1 | jq -r .$2)
echo $value
}
is_array() {
local variable_name=$1
[[ "$(declare -p $variable_name 2>/dev/null)" =~ "declare -a" ]]
}