Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "images1" :
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-Small@2x.png",
- "scale" : "2x"
- },
- "images2" :
- {
- "size" : "29x30",
- "idiom" : "iphone2",
- "filename" : "Icon-Small@2x.png2",
- "scale" : "22x"
- }
- }
- $ jq '.["images1"]' file.json
- {
- "size": "29x29",
- "idiom": "iphone",
- "filename": "Icon-Small@2x.png",
- "scale": "2x"
- }
- jq --arg var "images1" '.[$var]' file.json
- jq ".$1 | { keys: keys_unsorted, values: [.[]] }"
- $ echo '{
- "images1" :
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "Icon-Small@2x.png",
- "scale" : "2x"
- },
- "images2" :
- {
- "size" : "29x30",
- "idiom" : "iphone2",
- "filename" : "Icon-Small@2x.png2",
- "scale" : "22x"
- }
- }' | jq ".images1 | { keys: keys_unsorted, values: [.[]] }"
- {
- "keys": [
- "size",
- "idiom",
- "filename",
- "scale"
- ],
- "values": [
- "29x29",
- "iphone",
- "Icon-Small@2x.png",
- "2x"
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement