Untitled

 avatar
unknown
plain_text
2 years ago
311 B
5
Indexable
# Capture the output from yq
output=$(yq e '.builds | map("\(.name)=\(.tests[0].eksVersion)") | join(" ")' <<< "$yaml_data")

# Convert the space-separated values to a Bash associative array
declare -A my_map
eval "my_map=($output)"

# Access values using keys
echo "v1: ${my_map[v1]}"
echo "v2: ${my_map[v2]}"
Editor is loading...
Leave a Comment