#!/bin/bash if [ $# -eq 0 ] then files=`ls ./*.y` else files="$*" fi pngs="" for file in $files do base=${file%.y} png=${base}.png pngs="$pngs $png" echo "yacc -v \"$file\" && cat y.output | yacc2dot | dot -Tpng > \"$png\"" yacc -v "$file" && \ cat y.output | \ yacc2dot | \ dot -Tpng > "$png" if [ $? -ne 0 ] then exit 1 fi output=${base}.output mv y.output "$output" done qiv $pngs &