Check cwm installation and output OK files
authorStian Soiland-Reyes <soiland-reyes@cs.manchester.ac.uk>
Mon, 02 Jul 2012 22:14:25 +0100
changeset 3587 41d010028b2b
parent 3586 a3f9b75152c1
child 3588 c2e2917fcfac
Check cwm installation and output OK files

Files with error show cwm's error message on stderr
stdout shows files that are OK
examples/eg-24-prov-o-html-examples/rdf/create/check-with-cwm.bash
--- a/examples/eg-24-prov-o-html-examples/rdf/create/check-with-cwm.bash	Mon Jul 02 21:57:28 2012 +0100
+++ b/examples/eg-24-prov-o-html-examples/rdf/create/check-with-cwm.bash	Mon Jul 02 22:14:25 2012 +0100
@@ -1,2 +1,17 @@
 #!/bin/bash
-for f in $(find . -name *ttl) ; do cwm $f > /dev/null || echo -------------- ; done
+
+set -e
+
+# Check if cwm is installed
+cwm < /dev/null > /dev/null || {
+    echo "Try:
+    sudo apt-get install cwm
+or install from:
+    http://www.w3.org/2000/10/swap/doc/cwm.html" >&2 ; exit
+}
+
+# Check each file with cwm, echo filename if OK
+# cwm will output any errors to stderr otherwise
+for f in $(find rdf -name '*ttl') ; do 
+    cwm $f > /dev/null && echo $f
+done