@Konrad: tail does not return an empty line. I made a file that has some text that doesn't end in newline and a file that does. Here is the output from tail:
$ cat test_no_newline.txt
this file doesn't end in newline$
$ cat test_with_newline.txt
this file ends in newline
$
Though I found that tail has get last byte option. So I modified your script to:
#!/bin/sh
c=`tail -c 1 $1`
if [ "$c" != "" ]; then
echo "no newline"
fi
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…