Skip to content

Instantly share code, notes, and snippets.

@mautematico mautematico/split-posts.sh
Last active Jan 23, 2016

Embed
What would you like to do?
#!/bin/bash
cat posts.json | jq -c -M '.[]' | sed 's/\\"/\\\\"/g' | \
while read single_post;
do
post_id=$(echo $single_post | jq '.ID');
echo $single_post > post/$post_id.json;
done
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.