#!/bin/sh F1=/tmp/testfile.working F2=/tmp/testfile.broken showcontents() { f="$1" echo -e "Contents of $f\n---" cat $f echo "---" } echo "Compiling binaries" g++ -Wall edtest.cpp -o edtest.working -DWORKING g++ -Wall edtest.cpp -o edtest.broken echo "### Input to working binary" echo hello >$F1 showcontents $F1 echo "### Running working binary" ./edtest.working $F1 echo "### Output from working binary" showcontents $F1 echo "### Input to broken binary" echo hello >$F2 showcontents $F2 echo "### Running broken binary" ./edtest.broken $F2 echo "### Output from broken binary" showcontents $F2