whitespace.sh 180 B

12345678910111213
  1. #!/bin/bash
  2. RESULT=0
  3. for i in "$@"; do
  4. a="`tail -c 1 "$i"`"
  5. if [ "$a" != "" ]; then
  6. echo "$i does not have a trailing newline" 1>&2
  7. RESULT=-1
  8. fi
  9. done
  10. exit $RESULT