#!/bin/sh

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

#!/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

--- 
+++ 
@@ -1,6 +1,9 @@
 #!/bin/sh
 
 for i in ./study/0/*.json; do
-    echo "Validating $i"
-    python -mjson.tool $i /dev/null || exit $?
+    echo "Validating ./study/0/$i"
+    cat $i | python -mjson.tool > /dev/null
+    if [ $? -ne 0 ]; then
+        exit $?
+    fi
 done
Exit with the proper error code when a JSON file is invalid
