#!/bin/sh
STATUS=0
for i in $(make -C testi listfortunes | head -2 | tac | head -1); do
    if ! tac testi/$i | head -1 | grep % > /dev/null; then
        echo "ERROR IN FILE $i"
        echo "Does not end with a % sign"
        STATUS=1
    fi
done

exit $STATUS
