#!/bin/sh if test $# -eq 0 then test "$(od)" || test "$(tail -c 1)" && \ >&2 printf ": Missing final newline\n" && \ exit 1 fi s=0 for f in "$@" do test -d "$f" && continue if ! test "$(od "$f")" || test "$(tail -c 1 "$f")" then >&2 printf "%s: Missing final newline\n" "$f" s=1 fi done exit $s