Skip to content

Instantly share code, notes, and snippets.

@d-baranowski
Created December 11, 2019 10:27
Show Gist options
  • Save d-baranowski/7a1880372c3ad27a4f37125d7ad0b8a1 to your computer and use it in GitHub Desktop.
Save d-baranowski/7a1880372c3ad27a4f37125d7ad0b8a1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
jq -cr 'keys[] as $k | "\($k)\n\(.[$k])"' $1 | while read -r key; do
tmpfile=$(mktemp /tmp/item.XXXXXX)
read -r item
printf '%s' "$item" > "$tmpfile"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment