#!/bin/bash f=ftypes.hs f=$1 echo Looking for double quotes, apostrophes, and decimal digits... grep \[\'\"0-9\] $f && failed1=1 echo "Looking for true|false|::|fst|snd|@|where|let|do|case..." egrep -iw "true|false|::|fst|snd|@|where|let|do|case|if|else" $f && failed2=1 echo "Looking for imports other than Data.Char..." grep -i import $f | grep -v Data.*Char && failed3=1 #grep -P "^[^\s]+" $f if [ -z "$failed1$failed2$failed3" ] then #echo 0 echo Nothing found--good! exit 0 else #echo 1 echo Found some possible violations exit 1 fi