# Checks that every file named is a valid JSON text (controlli.sh), with json.awk: # # LC_ALL=C awk -f json.awk -f json-valido.awk ... # # Prints «file: reason» for each file that is not, and on stderr how many were checked; exits with 1 if one is not. function json_begin(file) {} function json_open(kind) {} function json_close(kind) {} function json_scalar(kind, value) {} function json_end(file, error) { checked++ if (error != "") { print file ": " error broken++ } } END { printf " %d file controllati\n", checked > "/dev/stderr" exit (broken > 0 ? 1 : 0) }