#!/bin/bash # ex4 is not SPARQL (no COUNT) VALID="$(echo ex{1,2,3,4,5,6,7,8,9}.rq)" #VALID="ex1.rq" function validateOne { F=$1 echo "== $F" X="$(qparse -num off --query $F)" if [ $? != 0 ] then echo "Illegal syntax : $F" echo "$X" return ; fi ## Check the printed output ## echo "$X" qparse -n "$X" if [ $? != 0 ] then echo "Illegal printed syntax : $F" echo "$X" return ; fi } for f in $VALID do validateOne $f done