>>652
それ、自分が前悩んで作ったのがある。誰か改善してくれ
#!/bin/sh
file=$1
test -f $file || exit 0

# if size -eq 0; then exit 0
if [ ! -s $file ]; then
 exit 0
fi

# if the last character is not \n, then echo
if [ "$(tail -c 1 $file | cat -A)" != "$" ]; then
 echo
fi
if ! tail -n 1 $file | grep '^$' > /dev/null ; then
 echo
fi