1 #add linefeed if there isn't
4 [ ! -f "$FILE" ] && touch "$FILE" && exit 0
6 SIZE
=`stat -c '%s' "$FILE"`
8 [ "$retval" != 0 ] && exit $retval
10 [ "$SIZE" -lt 1 ] && exit 0
12 FEND
=`od -v -A n -t x1 -N 1 -j $(expr $SIZE - 1) "$FILE"`
14 [ "$retval" != 0 ] && exit $retval
16 [ "$FEND" != " 0a" ] && echo >> "$FILE" || true