Skip to content

Instantly share code, notes, and snippets.

@kaihendry
Created September 23, 2020 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaihendry/57daa9980d7ec8ee9c9c28cca0b9457a to your computer and use it in GitHub Desktop.
Save kaihendry/57daa9980d7ec8ee9c9c28cca0b9457a to your computer and use it in GitHub Desktop.
#!/bin/bash
cat << EOF |
[{
"name": "A water bottle",
"sku": "wrt1"
},{
"name": "Water bottles",
"sku": "wrt6"
}
]
EOF
jq -r '.[]|.name,.sku' |
while read -r name
read -r sku; do
printf "Name: %s SKU: %s\n" "$name" "$sku"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment