Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
311 B
2
Indexable
Never
# 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]}"
Leave a Comment