#!/bin/sh

for i in ./study/0/*.json; do
    echo "Validating ./study/0/$i"
    cat $i | python -mjson.tool > /dev/null
    if [ $? -ne 0 ]; then
        exit $?
    fi
done

#!/bin/sh

for i in ./study/0/*.json; do
    echo "Validating $i"
    python -mjson.tool $i /dev/null || exit $?
done

Exit with the proper error code when a JSON file is invalid
Exit with the proper error code when a JSON file is invalid
