-test -s checklicense_new_files.out || exit 0
-grep -L 'his file is part of NIT' `cat checklicense_new_files.out` 2>/dev/null | tee checklicense_missing.out
-test \! -s checklicense_missing.out
+if test \! -s checklicense_new_files.out; then
+ echo "No new files"
+ exit 0
+fi
+grep -L '\(^\|\b\)# [Tt]his file is part of NIT ' `cat checklicense_new_files.out` 2>/dev/null > checklicense_missing.out || true
+if test -s checklicense_missing.out; then
+ echo "These files are missing their licence:"
+ echo ""
+ cat checklicense_missing.out
+ echo ""
+ echo "Please double check that the licence text (i.e. \`This file is part of NIT...\`) is included at the begin of these files."
+ exit 1
+else
+ echo "All `cat checklicense_new_files.out | wc -l` checked new files have a correct license."
+ exit 0
+fi