How to convert a subset of YAML into an indexed array of associative arrays?
问题 I am using Bash 4.3 on linux. I have this simple YAML-esque data file: products: product1: name: "Product one" price: 100 product2: name: "Product two" price: 200 myList: - one - two And I need a shell function that, taking the above YAML file as input, can generate and then execute the below Bash code: unset products product1 product2 # declare the associative arrays declare -A product1 declare -A product2 # define the data product1=( [name]="Product 1" [price]=100 ) product2=( [name]=