Skip to content

Instantly share code, notes, and snippets.

@ksalman
Forked from kamiller/validate_json.sh
Created August 1, 2021 19:29
Show Gist options
  • Save ksalman/89993255c9855559def859d458a6aa17 to your computer and use it in GitHub Desktop.
Save ksalman/89993255c9855559def859d458a6aa17 to your computer and use it in GitHub Desktop.
validate json with python via bash script
echo '{"foo":"bar"}' | python -m json.tool >> /dev/null && exit 0 || echo "NOT valid JSON"; exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment