curl http://plytix-charts.core.private-plytix.com:8080/api/charts -o charts.json
cat charts.json | yq e -P ' .[].[] | select(.name =="mongo*") | (.name + "," + .version)'
yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' f1.yml f2.yml
cat somefile.yml | yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' f1.yml -
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' a.yml b.yml
diff <(yq -P 'sort_keys(..)' -o=props a.yml) <(yq -P 'sort_keys(..)' -o=props b.yml)
#!/bin/bash
yq e '.adminer' B.yml > B0.yml yq e '.adminer' C.yml > C0.yml
yq ea 'select(fileIndex == 0) * select(fileIndex == 1)' A.yml B0.yml |
perl -pe 's|\s*#.+$||' |
perl -pe 's|^.+: []$||' | perl -pe 's|^.+: {}$||' |
perl -pe 's|^\s+$||' > B1.yml
yq ea 'select(fileIndex == 0) * select(fileIndex == 1)' A.yml C0.yml |
perl -pe 's|\s*#.+$||' |
perl -pe 's|^.+: []$||' | perl -pe 's|^.+: {}$||' |
perl -pe 's|^\s+$||' > C1.yml
yq ea 'select(fileIndex == 0) * select(fileIndex == 1)' B1.yml C0.yml |
perl -pe 's|\s*#.+$||' |
perl -pe 's|^.+: []$||' | perl -pe 's|^.+: {}$||' |
perl -pe 's|^\s+$||' > C2.yml
diff <(yq -P 'sort_keys(..)' -o=props C2.yml) <(yq -P 'sort_keys(..)' -o=props C1.yml) > diff.txt
cat diff.txt | grep -P '^>' | perl -pe 's|^> ||' > in.txt cat diff.txt | grep -P '^<' | perl -pe 's|^< (.+) = .+$|\1|' > out.txt
yq -oy -p=props -P in.txt > result.yml
yq ea 'select(fileIndex == 0) * select(fileIndex == 1)' C0.yml result.yml |
perl -pe 's|\s*#.+$||' |
perl -pe 's|^.+: []$||' | perl -pe 's|^.+: {}$||' |
perl -pe 's|^\s+$||' > final.yml